mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
add global state
This commit is contained in:
16
store/index.ts
Normal file
16
store/index.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { create } from 'zustand';
|
||||
|
||||
interface MainStore {
|
||||
modelLoading: boolean;
|
||||
toggleLoading: (loaded: boolean) => void;
|
||||
}
|
||||
|
||||
const useMainStore = create<MainStore>()((set) => ({
|
||||
modelLoading: true,
|
||||
toggleLoading: (loaded) =>
|
||||
set(() => ({
|
||||
modelLoading: loaded,
|
||||
})),
|
||||
}));
|
||||
|
||||
export default useMainStore;
|
Reference in New Issue
Block a user