Files
blitzkit/src/stores/session.ts
T

21 lines
514 B
TypeScript
Raw Normal View History

2023-09-19 15:52:39 +00:00
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' })),
);