Files
pedwfrontend/store/currentView/reducer.js
T
2021-08-02 16:29:13 +01:00

24 lines
622 B
JavaScript

import { currentViewActionTypes } from "./action";
const currentViewInitialState = {
currentView: {},
caseReference: {},
};
export default function reducer(state = currentViewInitialState, action) {
switch (action.type) {
case currentViewActionTypes.SETCURRENTVIEW:
return {
...state,
currentView: action.currentView,
};
case currentViewActionTypes.SETCURRENTREFERENCE:
return {
...state,
caseReference: action.caseReference,
};
default:
return state;
}
}