import { combineReducers } from 'redux-immutable'; import { Map, List } from 'immutable'; import { AnyAction } from 'redux'; // Dummy State interface interface State { }; /** * Combine reducers should work with only one argument (a reducers object). */ combineReducers({}); combineReducers({}); /** * Combine reducers support reducer with custom action */ combineReducers({ reducerNumber: (state: number, action: { type: string; payload: number }) => { switch(action.type) { case 'multiply': return state * action.payload default: return state } }, reducerString: (state: string, action: { type: string; payload: string }) => { switch(action.type) { case 'concat': return state.concat(action.payload) default: return state } }, }); /** * Combine reducers should accepts a function (getDefaultState()) as a second parameter, that returns an immutable Collection.Keyed collection. */ combineReducers({}, () => { return Map(); }); combineReducers({}, () => { return Map(); }); /** * Combine reducers should accepts a function (getDefaultState()) as a second parameter, that returns an immutable Collection.Indexed collection. */ combineReducers({}, () => { return List(); });