mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: expand session stats
This commit is contained in:
1 parent
a53c20fa6a
commit
84dd3317dc
2 files changed
+64
-49
No files matched your search
@@ -1,11 +1,15 @@
|
||||
import type { IndividualTankStats, Region, Stat } from '@blitzkit/core';
|
||||
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';
|
||||
|
||||
interface SessionBase {
|
||||
columns: Stat[];
|
||||
columns: CompositeStatsKey[];
|
||||
}
|
||||
|
||||
export interface SessionTracking extends SessionBase {
|
||||
@@ -28,10 +32,15 @@ export const Session = createContextualStore(() =>
|
||||
create<Session>()(
|
||||
persist(
|
||||
(_) => ({
|
||||
columns: ['battles', 'winrate', 'wn8', 'averageDamage'],
|
||||
columns: [
|
||||
'cumulative_battles',
|
||||
'normalized_wins',
|
||||
'cumulative_wn8',
|
||||
'normalized_damage_dealt',
|
||||
],
|
||||
tracking: false,
|
||||
}),
|
||||
{ name: 'session-2', merge: (a, b) => merge(b, a) },
|
||||
{ name: 'session-3', merge: (a, b) => merge(b, a) },
|
||||
),
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user