feat: upgrade Session

This commit is contained in:
TrèsAbhi committed 2025-09-01 19:16:36 -05:00
1 parent 6d24ed92d0
commit b3a9f0889e
3 files changed
+57 -67

No files matched your search

+13 -20
View File
@@ -2,11 +2,8 @@ import type {
CompositeStatsKey,
IndividualTankStats,
Region,
} from '@blitzkit/core';
import { merge } from 'lodash-es';
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
import { createContextualStore } from '../core/zustand/createContextualStore';
} from "@blitzkit/core";
import { Varuna } from "varuna";
interface SessionBase {
columns: CompositeStatsKey[];
@@ -28,19 +25,15 @@ interface SessionNotTracking extends SessionBase {
type Session = SessionTracking | SessionNotTracking;
export const Session = createContextualStore(() =>
create<Session>()(
persist(
(_) => ({
columns: [
'cumulative_battles',
'normalized_wins',
'cumulative_wn8',
'normalized_damage_dealt',
],
tracking: false,
}),
{ name: 'session-3', merge: (a, b) => merge(b, a) },
),
),
export const Session = new Varuna<Session>(
{
columns: [
"cumulative_battles",
"normalized_wins",
"cumulative_wn8",
"normalized_damage_dealt",
],
tracking: false,
},
"session-4"
);