Files
frontend/apps/dm/app/store/store.tsx
T

23 lines
694 B
TypeScript

import { createStore } from 'zustand/vanilla';
import { CommonReducer, CommonState, type CommonStore, type CommonType } from './common';
import { SdmReducer, SdmState, type SdmStore, type SdmType } from './sdmMng';
import { dmMapState, type DmMapType, type DmMapStore, DmMapReducer } from './map';
export type DmStore = CommonStore & SdmStore &DmMapStore ;
export type DmState = CommonType & SdmType &DmMapType;
export const StoreZus = (initState: DmState= {
...CommonState,
...SdmState,
...dmMapState,
}) => {
return createStore<DmStore>()((set) => {
return {
...initState,
...CommonReducer(set),
...SdmReducer(set),
...DmMapReducer(set)
}
})
}