State object
This commit is contained in:
parent
142b9d2a9d
commit
ab952ddec4
1 changed files with 57 additions and 0 deletions
57
utils/state.tsx
Normal file
57
utils/state.tsx
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import { proxy } from "valtio";
|
||||
|
||||
interface State {
|
||||
app: {
|
||||
authenticated: boolean
|
||||
},
|
||||
party: {
|
||||
id: string | undefined,
|
||||
editable: boolean,
|
||||
element: number,
|
||||
extra: boolean
|
||||
},
|
||||
grid: {
|
||||
weapons: {
|
||||
mainWeapon: GridWeapon | undefined,
|
||||
allWeapons: GridWeapon[]
|
||||
},
|
||||
summons: {
|
||||
mainSummon: GridSummon | undefined,
|
||||
friendSummon: GridSummon | undefined,
|
||||
allSummons: GridSummon[]
|
||||
},
|
||||
characters: GridCharacter[]
|
||||
},
|
||||
search: {
|
||||
sourceItem: GridCharacter | GridWeapon | GridSummon | undefined
|
||||
}
|
||||
}
|
||||
|
||||
const state: State = {
|
||||
app: {
|
||||
authenticated: false
|
||||
},
|
||||
party: {
|
||||
id: undefined,
|
||||
editable: false,
|
||||
element: 0,
|
||||
extra: false
|
||||
},
|
||||
grid: {
|
||||
weapons: {
|
||||
mainWeapon: undefined,
|
||||
allWeapons: Array<GridWeapon>()
|
||||
},
|
||||
summons: {
|
||||
mainSummon: undefined,
|
||||
friendSummon: undefined,
|
||||
allSummons: Array<GridSummon>()
|
||||
},
|
||||
characters: Array<GridCharacter>()
|
||||
},
|
||||
search: {
|
||||
sourceItem: undefined
|
||||
}
|
||||
}
|
||||
|
||||
export default proxy(state)
|
||||
Loading…
Reference in a new issue