...
|
...
|
@@ -5,11 +5,14 @@ import Immutable, {Map} from 'immutable'; |
|
|
|
|
|
const {
|
|
|
SET_TYPE,
|
|
|
GET_CATEGORY_SUCCESS,
|
|
|
|
|
|
SET_CURRENT_CATEGORY_ID,
|
|
|
SET_CURRENT_CHANNEL_ID,
|
|
|
|
|
|
GET_CATEGORY_REQUEST,
|
|
|
GET_CATEGORY_SUCCESS,
|
|
|
GET_CATEGORY_FAILURE,
|
|
|
|
|
|
JUMP_TO_CATEGORY,
|
|
|
} = require('../../constants/actionTypes').default;
|
|
|
|
...
|
...
|
@@ -21,6 +24,9 @@ export default function categoryReducer(state=initialState, action) { |
|
|
case SET_TYPE: {
|
|
|
return state.set('type', action.payload);
|
|
|
}
|
|
|
case GET_CATEGORY_REQUEST: {
|
|
|
return state.set('isFetching', true);
|
|
|
}
|
|
|
case GET_CATEGORY_SUCCESS:{
|
|
|
let {
|
|
|
boy,
|
...
|
...
|
@@ -31,7 +37,11 @@ export default function categoryReducer(state=initialState, action) { |
|
|
return state.setIn(['categoryList', 'boy'],Immutable.fromJS(boy))
|
|
|
.setIn(['categoryList', 'girl'],Immutable.fromJS(girl))
|
|
|
.setIn(['categoryList', 'kids'],Immutable.fromJS(kids))
|
|
|
.setIn(['categoryList', 'lifestyle'],Immutable.fromJS(lifestyle));
|
|
|
.setIn(['categoryList', 'lifestyle'],Immutable.fromJS(lifestyle))
|
|
|
.set('isFetching', false);
|
|
|
}
|
|
|
case GET_CATEGORY_FAILURE: {
|
|
|
return state.set('isFetching', false);
|
|
|
}
|
|
|
case SET_CURRENT_CATEGORY_ID:{
|
|
|
return state.set('currentCateId',Immutable.fromJS(action.payload));
|
...
|
...
|
|