outOfStockReducer.js 796 Bytes

'use strict';
/**
 * ## Imports
 *
 * InitialState
 */
import InitialState from './outOfStockInitialState';

import Immutable, {List, Record} from 'immutable';

const {

	STOCKOUT_REQUEST,
	STOCKOUT_SUCCESS,
	STOCKOUT_FAILURE,

} = require('../../constants/actionTypes').default;

const initialState = new InitialState;

/**
 * ## guideReducer function
 * @param {Object} state - initialState
 * @param {Object} action - type and payload
 */
export default function userReducer(state = initialState, action) {
    if (!(state instanceof InitialState)) return initialState.merge(state);

    switch (action.type) {
		case STOCKOUT_REQUEST:{
			return state;
		}
		case STOCKOUT_SUCCESS:{
			return state;
		}
		case STOCKOUT_FAILURE:{
			return state;
		}
		return state;
	}

    return state;
}