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

70 lines
1.6 KiB
TypeScript

import { createStore } from "zustand/vanilla";
import {
pubFacActionsExport,
pubFacStateExport,
type pubFacState,
type pubFacType,
} from "./ruseFcltMng/fcltReg/pbnstReg";
import {
rainFacActionsExport,
rainFacStateExport,
type rainFacState,
type rainFacType,
} from "./ruseFcltMng/fcltReg/rainReg";
import {
rswtFacActionsExport,
rswtFacStateExport,
type rswtFacState,
type rswtFacType,
} from "./ruseFcltMng/fcltReg/rswtReg";
import {
matDmdActionsExport,
matDmdStateExport,
type matDmdState,
type matDmdType,
} from "./matDmd";
import {
htdflFacActionsExport,
htdflFacStateExport,
type htdflFacState,
type htdflFacType,
} from "./ruseFcltMng/fcltReg/htdflReg";
import { codeActionExport, comCodeStateExport, getCityCd, getSggCd, type comCodeState, type comCodeType } from "./common/code";
export type WrStore = comCodeType&
pubFacType &
rainFacType &
rswtFacType &
matDmdType &
htdflFacType;
export const StoreZus = (
initState: comCodeState&
rainFacState &
pubFacState &
rswtFacState &
matDmdState &
htdflFacState = {
...comCodeStateExport,
...pubFacStateExport,
...rainFacStateExport,
...rswtFacStateExport,
...matDmdStateExport,
...htdflFacStateExport,
}
) => {
return createStore<WrStore>()((set) => {
getSggCd(set),
getCityCd(set)
return {
...initState,
...pubFacActionsExport(set),
...rainFacActionsExport(set),
...rswtFacActionsExport(set),
...matDmdActionsExport(set),
...htdflFacActionsExport(set),
...codeActionExport(set),
};
});
};
//store 등록하는 부분