UNPKG

redux-seamless-immutable

Version:
13 lines (11 loc) 364 B
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 }