contentReducer.js
707 Bytes
'use strict';
import InitialState from './contentInitialState';
import Immutable, {Map} from 'immutable';
const {
SET_CONTENT_LIST_ID,
SET_CONTENT_CATEGORY_NAME,
SET_CONTENT_TIP_FLAG,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
export default function grassReducer(state=initialState, action) {
switch(action.type) {
case SET_CONTENT_LIST_ID: {
return state.set('contentListId', action.payload);
}
case SET_CONTENT_CATEGORY_NAME: {
return state.set('contentCategoryName', action.payload);
}
case SET_CONTENT_TIP_FLAG: {
return state.set('contentTipFlag', action.payload);
}
}
return state;
}