redux-leaves
redux-leaves copied to clipboard
Create examples which show usage with React components
Do you have any plans to create examples which show how this can be used with a typical React application? I started experimenting with the project today and realised there was a no quick reference which shows how you would wire this up to an existing React application.
Thanks @CarlMungazi! Great question - this is definitely something that will be useful.
As per my comment in your useReducer
issue, I will be supporting Riduce rather than Redux-Leaves (same API, significant refactor, different branding) but I definitely do intend to do more comprehensive React examples for that.
Here's one React example for Riduce. It's very small.
The recipe for larger apps would be basically the same as a useReducer + useContext recipe, e.g.:
- https://hswolff.com/blog/how-to-usecontext-with-usereducer/
- https://blog.logrocket.com/use-hooks-and-context-not-react-and-redux/
where the job of Riduce (or Redux-Leaves) is to replace the reducer
, but otherwise it's exactly the same.
At some point, I might build a useRiduce
hook of some sort, but it's not an immediate priority.
Does that help, or is there anything I should try to clarify?
No, that's pretty clear. When I migrate to the new lib I will hit you up if I get stuck.