redux-seamless-immutable
Version:
Helpers for using seamless-immutable with Redux
13 lines (11 loc) • 364 B
JavaScript
import Immutable from 'seamless-immutable';
import { LOCATION_CHANGE } from 'react-router-redux';
const initialState = Immutable({
locationBeforeTransitions: null
});
export default function routerReducer(state=initialState, { type, payload }) {
if (type === LOCATION_CHANGE) {
return state.set('locationBeforeTransitions', payload);
}
return state
}