24 lines
468 B
TypeScript
24 lines
468 B
TypeScript
|
|
import { create } from 'zustand'
|
||
|
|
|
||
|
|
interface AppState {
|
||
|
|
version: number
|
||
|
|
hasUpdate: boolean
|
||
|
|
hasInit: boolean
|
||
|
|
notice: string
|
||
|
|
useMirror: boolean
|
||
|
|
init: () => void
|
||
|
|
}
|
||
|
|
|
||
|
|
const useAppStore = create<AppState>()((/* set */) => ({
|
||
|
|
version: 0,
|
||
|
|
hasUpdate: false,
|
||
|
|
hasInit: false,
|
||
|
|
notice: "",
|
||
|
|
useMirror: true,
|
||
|
|
init: () => {
|
||
|
|
console.log('init')
|
||
|
|
},
|
||
|
|
// increasePopulation: () => set((state) => ({ bears: state.bears + 1 })),
|
||
|
|
}))
|
||
|
|
|
||
|
|
export default useAppStore
|