update: add zustand store and basic setup

This commit is contained in:
purp1e
2024-09-21 02:25:23 +08:00
parent 6625e0c57d
commit b3973fd101
10 changed files with 202 additions and 1 deletions

20
src/store/tool.ts Normal file
View File

@@ -0,0 +1,20 @@
import { create } from 'zustand'
export interface ToolState {
launchOptions: string[]
launchIndex: number
powerPlan: number
init: () => void
}
const useToolStore = create<ToolState>()((/* set */) => ({
launchOptions: ["-novid -nojoy -high -freq 120 -tickrate 128", "", ""],
launchIndex: 0,
powerPlan: 0,
init: () => {
console.log('init')
},
// increasePopulation: () => set((state) => ({ bears: state.bears + 1 })),
}))
export default useToolStore