listReducer.js 924 Bytes
'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;
}