19 lines
537 B
TypeScript
19 lines
537 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';
|
|
|
|
export type DmStore = CommonStore & SdmStore;
|
|
export type DmState = CommonType & SdmType;
|
|
|
|
export const StoreZus = (initState: DmState= {
|
|
...CommonState,
|
|
...SdmState,
|
|
}) => {
|
|
return createStore<DmStore>()((set) => {
|
|
return {
|
|
...initState,
|
|
...CommonReducer(set),
|
|
...SdmReducer(set)
|
|
}
|
|
})
|
|
} |