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

123 lines
4.0 KiB
TypeScript

import { createStore } from "zustand/vanilla";
import { codeActionExport, comCodeStateExport, getCityCd, getEnvPartCd, getMiddleRegionCd, getRegionCd, getSggCd, getUnitWaterShedCd, type comCodeState, type comCodeType } from "./common/code";
import {
matDmdActionsExport,
matDmdStateExport,
type matDmdState,
type matDmdType,
} from "./matDmd";
import { rainChkgdnActionsExport, rainChkgdnStateExport, type rainChkgdnState, type rainChkgdnType } from "./prfmncReg/chkgdnReg/rainChkgdn";
import { rswtChkgdnActionsExport, rswtChkgdnStateExport, type rswtChkgdnState, type rswtChkgdnType } from "./prfmncReg/chkgdnReg/rswrtChkgdn";
import { bdstActionsExport, bdstStateExport, type bdstFulType, type bdstState } from "./ruseFcltMng/fcltReg/bdstReg";
import {
htdflFacActionsExport,
htdflFacStateExport,
type htdflFacState,
type htdflFacType,
} from "./ruseFcltMng/fcltReg/htdflReg";
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 { rainSttnActionsExport, rainSttnStateExport, type rainSttnState, type rainSttnType } from "./ruseFcltMng/fcltSttn/rainSttn";
import { rswtSttnActionsExport, rswtSttnStateExport, type rswtSttnState, type rswtSttnType } from "./ruseFcltMng/fcltSttn/rswtSttn";
import { htdflSttnActionsExport, htdflSttnStateExport, type htdflSttnState, type htdflSttnType } from "./ruseFcltMng/fcltSttn/htdflSttn";
import { pbnstSttnActionsExport, pbnstSttnStateExport, type pbnstSttnState, type pbnstSttnType } from "./ruseFcltMng/fcltSttn/pbnstSttn";
import { coSttnActionsExport, coSttnStateExport, type coSttnState, type coSttnType } from "./matDmd/coSttn"; // 옮겨야함
import { ldrmntCoSttnActionsExport, ldrmntCoSttnStateExport, type ldrmntCoSttnState, type ldrmntCoSttnType } from "./matDmd/ldrmntCoSttn"; // 옮겨야함
export type WrStore = comCodeType&
pubFacType &
rainFacType &
rswtFacType &
matDmdType &
htdflFacType&
bdstFulType&
rainChkgdnType&
rswtChkgdnType&
rainSttnType&
rswtSttnType&
htdflSttnType&
pbnstSttnType&
coSttnType& // 옮겨야함
ldrmntCoSttnType // 옮겨야함
;
export const StoreZus = (
initState: comCodeState&
rainFacState &
pubFacState &
rswtFacState &
matDmdState &
htdflFacState &
bdstState &
rainChkgdnState&
rswtChkgdnState&
rainSttnState&
rswtSttnState&
htdflSttnState&
pbnstSttnState&
coSttnState& // 옮겨야함
ldrmntCoSttnState // 옮겨야함
= {
...comCodeStateExport,
...pubFacStateExport,
...rainFacStateExport,
...rswtFacStateExport,
...matDmdStateExport,
...htdflFacStateExport,
...bdstStateExport,
...rainChkgdnStateExport,
...rswtChkgdnStateExport,
...rainSttnStateExport,
...rswtSttnStateExport,
...htdflSttnStateExport,
...pbnstSttnStateExport,
...coSttnStateExport, // 옮겨야함
...ldrmntCoSttnStateExport, // 옮겨야함
}
) => {
return createStore<WrStore>()((set) => {
getSggCd(set);
getCityCd(set);
getRegionCd(set);
getMiddleRegionCd(set);
getUnitWaterShedCd(set)
getEnvPartCd(set)
return {
...initState,
...pubFacActionsExport(set),
...rainFacActionsExport(set),
...rswtFacActionsExport(set),
...matDmdActionsExport(set),
...htdflFacActionsExport(set),
...codeActionExport(set),
...bdstActionsExport(set),
...rainChkgdnActionsExport(set),
...rswtChkgdnActionsExport(set),
...rainSttnActionsExport(set),
...rswtSttnActionsExport(set),
...htdflSttnActionsExport(set),
...pbnstSttnActionsExport(set),
...coSttnActionsExport(set), // 옮겨야함
...ldrmntCoSttnActionsExport(set), // 옮겨야함
};
});
};
//store 등록하는 부분