-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add connectRouter + example #7
Conversation
import counterReducer from './counter' | ||
|
||
const rootReducer = combineReducers({ | ||
count: counterReducer, | ||
router: routerReducer, | ||
count: counterReducer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add trailing comma to pass eslint.
count: counterReducer,
Need to modify ConnectedRouter.js also |
@dictions Need another little linting fix about trailing comma (#7 (review)) |
@supasate weird, I couldn't get eslint to fail with or without the trailing comma. |
Oh, I just noticed that I don't use airbnb rules in this project. My eyes worked like airbnb linting compiler lol. |
LGTM. Thank you for your contribution! |
Of course! Mind bumping the version on merge? |
Yes. I'll add some more details in the README before bumping version. |
Already released in v2.0.0-alpha.1 https://github.com/supasate/connected-react-router/releases |
Why is it a higher-order reducer? |
@wtgtybhertgeghgtwtg To initialize router state with current browser history. Additional benefit is users don't have to mount router reducer themselves coz it's automatically mounted. |
It complicates
would have to be replaced with
or, if you stored the result of the original
|
I see your point about replacing reducer. Without higher order reducer, we've ever tried with following methods.
(see our discussion here) Therefore, I think, currently, I choose to trade-off with a bit complication of replacing reducer until we find a better solution. If you have any idea, please let me know. |
Fixes #1