formStore 작업완료
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import type { selectArray } from "../rainReuseFacilityInsert";
|
||||
|
||||
|
||||
|
||||
const selectSido = [
|
||||
{ text: '서울', val: "1" },
|
||||
{ text: "인천", val: "2" },
|
||||
{ text: "부산", val: "2" },
|
||||
];
|
||||
const selectSgg = [
|
||||
{ text: '종로구', val: "1" },
|
||||
{ text: "성북구", val: "2" },
|
||||
{ text: "강남구", val: "2" },
|
||||
];
|
||||
const selectUsg = [
|
||||
{ text: '민간', val: "1" },
|
||||
{ text: "공공", val: "2" },
|
||||
];
|
||||
const selectYN= [
|
||||
{ text: 'Y', val: "1" },
|
||||
{ text: 'N', val: "2" },
|
||||
];
|
||||
|
||||
export type matDmdState ={ dmd:{
|
||||
isInit: boolean;
|
||||
selectSido:selectArray[];
|
||||
selectSgg:selectArray[];
|
||||
selectUsg:selectArray[];
|
||||
selectYN:selectArray[];
|
||||
}}
|
||||
type matDmdActions = {
|
||||
decrementList: () => void
|
||||
}
|
||||
|
||||
export type matDmdType = matDmdState & matDmdActions;
|
||||
|
||||
export const matDmdStateExport:matDmdState= {dmd:{
|
||||
isInit:false,
|
||||
selectSido:selectSido,
|
||||
selectSgg: selectSgg,
|
||||
selectUsg: selectUsg,
|
||||
selectYN:selectYN,
|
||||
|
||||
|
||||
}}
|
||||
export const matDmdActionsExport:(set:any)=>matDmdActions=(set: any) => {
|
||||
return {
|
||||
decrementList:()=>set(
|
||||
(state:matDmdState) => {
|
||||
return (
|
||||
{rain:{
|
||||
}})}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,23 @@ import { createStore } from 'zustand/vanilla';
|
||||
import { pubFacActionsExport, pubFacStateExport, type pubFacState } from './publicReuseFaciltyInsert/index';
|
||||
import { rainFacActionsExport, rainFacStateExport, type rainFacState, type rainFacType } from './rainReuseFacilityInsert';
|
||||
import { rswtFacActionsExport, rswtFacStateExport, type rswtFacState, type rswtFacType } from './rswtrReuseFaciltyInsert';
|
||||
import { matDmdActionsExport, matDmdStateExport, type matDmdState, type matDmdType } from './matDmd';
|
||||
|
||||
|
||||
export type WrStore = pubFacState & rainFacType &rswtFacType;
|
||||
export const StoreZus = (initState: rainFacState& pubFacState & rswtFacState= {
|
||||
export type WrStore = pubFacState & rainFacType &rswtFacType &matDmdType;
|
||||
export const StoreZus = (initState: rainFacState& pubFacState & rswtFacState &matDmdState= {
|
||||
...pubFacStateExport,
|
||||
...rainFacStateExport,
|
||||
...rswtFacStateExport
|
||||
...rswtFacStateExport ,
|
||||
...matDmdStateExport
|
||||
}) => {
|
||||
return createStore<WrStore>()((set) => {
|
||||
return {
|
||||
...initState,
|
||||
...pubFacActionsExport(set),
|
||||
...rainFacActionsExport(set),
|
||||
...rswtFacActionsExport
|
||||
...rswtFacActionsExport(set),
|
||||
...matDmdActionsExport(set)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user