Initial commit: Tapalka monorepo (bot, front, strapi)
This commit is contained in:
16
CMyTapper/robucks-front/store/player.state.ts
Normal file
16
CMyTapper/robucks-front/store/player.state.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { create } from 'zustand';
|
||||
import { IPlayer } from '@/interfaces/player.type';
|
||||
|
||||
interface IUserPlayer {
|
||||
player: IPlayer | null;
|
||||
isLoading: boolean;
|
||||
setPlayer: (player: IPlayer | null) => void;
|
||||
stopLoading: () => void;
|
||||
}
|
||||
|
||||
export const usePlayerStore = create<IUserPlayer>(set => ({
|
||||
player: null,
|
||||
isLoading: true,
|
||||
setPlayer: player => set(() => ({ player })),
|
||||
stopLoading: () => set(() => ({ isLoading: false })),
|
||||
}));
|
||||
Reference in New Issue
Block a user