News for hackers. Stuff that matters.
Re:Things I wish I knew about state management when I starte... by tempsy on Monday February 10, 2020 @12:24PM (#22291118)
I never understood why redux was considered "hard" - it basically keeps track of a plain javascript object that you can read/write across a react app
Re:Things I wish I knew about state management when I starte... by trufas on Monday February 10, 2020 @01:05PM (#22291538)
I think that plays along the lines of Rich Hickey's simple vs easy idea. Sure, a beginner will understand your explanation, but they might still run into trouble doing common UI things using it.

Redux also has a reputation for being annoying to write because people cargo cult it into any project regardless of scope and because utilities like the excellent `redux-toolkit` weren't and still aren't as widespread as they should be.

Re:Things I wish I knew about state management when I starte... by acemarke on Monday February 10, 2020 @01:28PM (#22291778)
> because utilities like the excellent `redux-toolkit` weren't and still aren't as widespread as they should be.

hey, I'm trying to broadcast it as much as I can :)

fwiw, the adoption curve is definitely going up:

https://npm-stat.com/charts.html?package=%40reduxjs%2Ftoolki...

And the growth of the RTK package is especially impressive given that we renamed it from "Redux Starter Kit" to "Redux Toolkit" _after_ we'd released RSK 1.0.

We'll emphasize RTK even more as part of the ongoing Redux core docs rewrite. My goal is that it ultimately becomes the default way to write Redux logic, in much the way that the Apollo folks tell you to use `apollo-boost` and React devs default to use Create-React-App.

Re:Things I wish I knew about state management when I starte... by tempsy on Monday February 10, 2020 @01:18PM (#22291684)
any mildly interesting SPA will need to keep track of state somehow. passing state between react components is more complicated than using redux.