I like coding, teaching and startups.
I'm author and maintainer of Redux-Leaves, https://redux-leaves.js.org.
I work as a Software Engineering Coach at WhiteHat.
Thanks for reading and responding - I'd not come across Easy Peasy, it's really interesting!
Simplifying Redux-Leaves
It's useful feedback to hear that you find Redux-Leaves complicated, as it's not intentionally so. This might be to do with how I presented it - the advanced usage is meant to be that, and simple usage covers the majority of cases.
In terms of the simple usage:
constinitialState={first:{arbitrarily:{nested:{counter:10}}},second:{path:{to:{counter:5}}}}// redux-leaves setupconst[reducer,actions]=reduxLeaves(initialState)// vanilla redux store setupconststore=createStore(initialState)// use redux-leaves actionsstore.dispatch(actions.first.arbitrarily.nested.counter.create.increment())store.getState().first.arbitrarily.nested.counter// => 11store.dispatch(actions.second.path.to.counter.create.increment(100))store.getState().second.path.to.counter// => 105
Is it the actions path that is the most complicated for you to understand?
It's meant to mimic how you'd describe the change happening:
at state.second.path.to.counter, you use actions.second.path.to.counter
then create an action, so actions.second.path.to.counter.create
and create an increment specifically, actions.second.path.to.counter.create.increment()
Does that make it clearer or does it still seem complicated?
Easy Peasy
It's got a similar API to Redux Toolkit, by the looks of it - which is really interesting and clearly works for a lot of people.
At a glance, it's got the same frustration I found with other approaches that I outlined - it's still premised on having to add specific cases to make updates to state, even for simple and repetitive things (like pushing to an array or incrementing a counter) - which you don't have to do with Redux-Leaves, since you: (a) get a bunch of defaults out of the box which you use at an arbitrary leaf of your state tree; and (b) if you want to use some custom logic, you can write it once and then use it anywhere in your state tree.
(With most other approaches, including Easy Peasy, you'd have to teach every child reducer [or 'model'] to do this.)
What do you think about that?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Personally I like easy-peasy.now.sh/ better. Seems less complicated.
Thanks for reading and responding - I'd not come across Easy Peasy, it's really interesting!
Simplifying Redux-Leaves
It's useful feedback to hear that you find Redux-Leaves complicated, as it's not intentionally so. This might be to do with how I presented it - the advanced usage is meant to be that, and simple usage covers the majority of cases.
In terms of the simple usage:
Is it the
actions
path that is the most complicated for you to understand?It's meant to mimic how you'd describe the change happening:
state.second.path.to.counter
, you useactions.second.path.to.counter
actions.second.path.to.counter.create
actions.second.path.to.counter.create.increment()
Does that make it clearer or does it still seem complicated?
Easy Peasy
It's got a similar API to Redux Toolkit, by the looks of it - which is really interesting and clearly works for a lot of people.
At a glance, it's got the same frustration I found with other approaches that I outlined - it's still premised on having to add specific cases to make updates to state, even for simple and repetitive things (like pushing to an array or incrementing a counter) - which you don't have to do with Redux-Leaves, since you: (a) get a bunch of defaults out of the box which you use at an arbitrary leaf of your state tree; and (b) if you want to use some custom logic, you can write it once and then use it anywhere in your state tree.
(With most other approaches, including Easy Peasy, you'd have to teach every child reducer [or 'model'] to do this.)
What do you think about that?