Redux framework is using reducers to change app state in response to an action.
The key requirement is that a reducer cannot modify an existing state object; it must
Taking your good example with Immutable
import {
ACTIVATE_LOCATION
} from './actions';
import { Map } from 'immutable';
const initialState = Map({})
export let ui = (state = initialState, action) => {
switch (action.type) {
case ACTIVATE_LOCATION:
return state.set('activeLocationId', action.id);
default:
return state;
}
};