listReducer.js
924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
import InitialState from './listInitialState';
import Immutable, {Map} from 'immutable';
const {
GET_ORDER_LIST_REQUEST,
GET_ORDER_LIST_SUCCESS,
GET_ORDER_LIST_FAILURE,
SET_FIRST_SHOW_INDEX,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
export default function listReducer(state=initialState, action) {
switch(action.type) {
case SET_FIRST_SHOW_INDEX: {
return state.set('firstShowIndex', action.payload);
}
case GET_ORDER_LIST_REQUEST: {
return state;
}
case GET_ORDER_LIST_SUCCESS: {
let {
list,
currentPage,
pageCount,
total,
endReached,
} = action.payload;
let newState = state
return newState;
}
case GET_ORDER_LIST_FAILURE: {
return state;
}
}
return state;
}