Created
August 10, 2018 05:35
-
-
Save maximgatilin/ff2c20683dc8b1782a0b3a7b494134a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {replace} from 'react-router-redux'; | |
| export default store => next => action => { | |
| if (action.pushToUrl) { | |
| const state = store.getState(); | |
| store.dispatch(replace({ | |
| pathname: state.routing.locationBeforeTransitions.pathname, | |
| query: { | |
| ...state.routing.locationBeforeTransitions.query, | |
| ...action.pushToUrl | |
| } | |
| })); | |
| } | |
| return next(action); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment