-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Usage with Redux #99
Comments
If you'd like to learn more about this, check out my recently published article on the topic: |
Is there a PR or complete example of this with integration with react-starter-kit + redux? The basic example is great but I get lost when I tried to integrate this with the current structure of RSK redux |
Hi! Sounds really interesting, can you open PR against feature/redux branch on React Starter Kit? Please, mention me and ping me if you need my attention! |
Wow, really late but I hope you are still interested! |
Hi all,
First of all, great work on this project. I like how
universal-router
isn't tightly coupled to the browser history/navigation code, making it a very versatile routing library.Speaking of which, it seems that the recommended way to navigate and respond to location changes is to pair
universal-router
+history
, as shown in #72 and in React Starter Kit.This generally works well — however, it doesn't fit into the Redux architecture and thus breaks the devtools experience (time-travel debugging, etc).
I'd like to share an alternative, "Redux-first" method for achieving navigation and location listening. It allows:
This is achievable with just a small amount of boilerplate code (Redux middleware, reducer, and action creators), which I've packaged into a library:
redux-first-routing
.Here's what you get on the state tree:
Together,
universal-router
+redux-first-routing
can be used to create a complete Redux routing solution for any front-end framework/library:You can find a basic code recipe and live demo here:
And you can apply the same techniques to a larger application, like React Starter Kit's
feature/redux
branch.Related: #43, #86
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: