update: add zustand store and basic setup
This commit is contained in:
24
src/store/app.ts
Normal file
24
src/store/app.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
Reference in New Issue
Block a user