9a5eee0afe12997ee71eeb9cc2d1bdf884f60df2
[aai/sparky-fe.git] / src / app / configurableViews / ConfigurableViewReducer.js
1 import {
2   configurableViewsActionTypes
3 } from './ConfigurableViewConstants.js';
4
5 export default (state = {}, action) => {
6   let data = action.data;
7   switch (action.type) {
8     case configurableViewsActionTypes.CONFIGURABLE_VIEWS_CONFIG_RECEIVED:
9       return {
10         ...state,
11         configurableViewsConfig: data
12       };
13     case configurableViewsActionTypes.CUSTOM_COMPONENTS_RECEIVED:
14       return {
15         ...state,
16         customComponents: data
17       };
18     case configurableViewsActionTypes.CUSTOM_ROUTES:
19       return {
20         ...state,
21         customRoutes: data
22       };
23   }
24
25   return state;
26 };