Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I didn't get the memo apparently. I still think Redux+Thunks+Selectors+Sagas is great and that combination solves all my problems. Boilerplate isn't negligible but relatively tame. There's a straightforward way how to model state, and I don't have to put too much logic (especially async) into components.

But that's just me...



Yeah I've always thought the complaints about boilerplate were misguided. Whatever the cost in boilerplate implementation was more than made up for by having predictable, deterministic UI output. That being said, I think hooks did open up the state management design space quite a bit and classic redux style state management doesn't quite line up with it. Still totally valid as an architecture, though, in my opinion.


Eh, as maintainer, I'd say the complaints about "boilerplate" were generally pretty accurate :)

As I've talked about in a couple posts and presentations [0] [1], there's a distinction between "inherent" and "incidental" complexity. Dispatching actions and using reducers is "inherent" - it's part of Redux, and you can't remove that because then it's not Redux. But things like writing `const ADD_TODO = "ADD_TODO"`, object spreads, etc, aren't _necessary_ for using Redux - they're inherent complexity.

Which is why we wrote Redux Toolkit to fix all that incidental complexity :)

Redux still won't ever be as few lines of code as various other libs, but writing Redux code today is much simpler than it was previously... and yes, the _benefits_ of Redux (predictable code, debugging, separation of state updates, middleware) are still entirely valuable.

[0] https://blog.isquaredsoftware.com/2022/06/presentations-mode...

[1] https://blog.isquaredsoftware.com/2019/10/redux-toolkit-1.0/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: