redux-leaves icon indicating copy to clipboard operation
redux-leaves copied to clipboard

Create examples which show usage with React components

Open CarlMungazi opened this issue 4 years ago • 2 comments

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.

CarlMungazi avatar Sep 15 '20 22:09 CarlMungazi

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.:

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?

richardcrng avatar Sep 18 '20 16:09 richardcrng

No, that's pretty clear. When I migrate to the new lib I will hit you up if I get stuck.

CarlMungazi avatar Sep 19 '20 03:09 CarlMungazi