News for hackers. Stuff that matters.
Re:Learn React for free by acemarke on Thursday November 29, 2018 @04:18PM (#18564106)
We've actually got a new `redux-starter-kit` package which includes some reducer utilities similar to `redux-actions`, but using the Immer library internally. That allows you to write simpler immutable updates that look like "mutation".

There's also some helpers for common use cases like simplifying store setup, and generating entire "slices" of state at once (including generating action creators and action types automatically).

I put together an example of using this the other day:

https://www.reddit.com/r/reactjs/comments/a0b1sa/frustrated_...

Please try it out and let us know what you think!

https://github.com/reduxjs/redux-starter-kit

Re:Learn React for free by crooked-v on Thursday November 29, 2018 @06:22PM (#18565130)
createSlice is an interesting approach, though it feels like it's missing the use case of being able to set multiple keys in the same reducer from one action, as with my valueAB example above. It might be worth putting some thought into how to make a variant of it that can produce multiple reducers (one per key to be affected), not just one.
Re:Learn React for free by acemarke on Thursday November 29, 2018 @06:48PM (#18565303)
Yeah, we had one user file an issue with some suggested improvements:

https://github.com/reduxjs/redux-starter-kit/issues/41

Haven't had time to dig into this further, though.

Think you could leave a comment there with your suggestions and that example?