mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
21 lines
514 B
TypeScript
21 lines
514 B
TypeScript
import { create } from 'zustand';
|
|||
|
|
import { devtools, persist } from 'zustand/middleware';
|
||
|
|
import { Region } from '../constants/regions';
|
||
|
|
import { NormalizedTankStats } from '../types/tanksStats';
|
||
|
|
|
||
|
|
type Session =
|
||
|
|
| {
|
||
|
|
isTracking: false;
|
||
|
|
}
|
||
|
|
| {
|
||
|
|
isTracking: true;
|
||
|
|
|
||
|
|
region: Region;
|
||
|
|
id: number;
|
||
|
|
nickname: string;
|
||
|
|
tankStats: NormalizedTankStats;
|
||
|
|
};
|
||
|
|
|
||
|
|
export const useSession = create<Session>()(
|
||
|
|
devtools(persist((set) => ({ isTracking: false }), { name: 'session' })),
|
||
|
|
);
|