screenSubReducer.js 551 Bytes
'use strict';

import InitialState from './screenSubInitialState';
import Immutable, {Map} from 'immutable';

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

const initialState = new InitialState;

export default function screenSubReducer(state=initialState, action) {
    switch(action.type){
        case SET_DATASOURCE_SUB:
            {
				return state.setIn(['filterSub', 'key'], action.payload.key)
					.setIn(['filterSub', 'list'], Immutable.fromJS(action.payload.list));
            }
	}
    return state;
}