evoleasing-account/reducers/eventsReducer.js
2022-09-12 22:54:12 +03:00

41 lines
630 B
JavaScript

import { HYDRATE } from 'next-redux-wrapper';
import * as actionTypes from '../constants/actionTypes';
import initialState from "./initialState";
const eventsReducer = (state = initialState.events, action) =>
{
switch (action.type)
{
case actionTypes.EVENTS:
{
return {
...state,
...action.data,
};
}
case actionTypes.EVENTS_FILTERED:
{
return {
...state,
...action.data,
};
}
case actionTypes.EVENTS_RESET:
{
return {
loaded: false,
list: undefined,
filtered: undefined,
};
}
default: {
return state;
}
}
};
export default eventsReducer;