Hacker News new | ask | show | jobs
by acemarke 3387 days ago
Hey, somebody actually referenced my Redux addons list! Yay! :)

Yeah, there's a great quote someone posted in a Redux issue a couple months back that summarizes things well [0]:

> Redux is a generic framework that provides a balance of just enough structure and just enough flexibility. As such, it provides a platform for developers to build customized state management for their use-cases, while being able to reuse things like the graphical debugger or middleware.

So, there's a couple ways to think about things. One is that Redux is a very simple pattern that provides just enough structure to point you in a direction, and lets you figure out what specific approaches work best for your own situation. Another is that Redux is too generic, and doesn't provide enough guidance or built-in stuff for various use cases.

I've been one of Redux's maintainers since last summer, and I've definitely seen certain requests pop up repeatedly. For example, we frequently have issues or PRs filed asking if we can modify `combineReducers` to have built-in support for iterating over and updating Immutable.js Maps and Lists. We've also had requests for `cR` to pass down the root state as a third arg to reducers by default, or something similar.

These aren't _bad_ requests, and there's clearly some valid use cases there. However, one of the key principles of Redux is that _reducer logic is just functions_. The standard answer we've given for the most part is just that "`combineReducers` is only intended for the most common and basic use case, but you should feel free to write your own reducer logic for your own use case". So, in that sense, that large list of reducer-related utilities is actually a _good_ thing, because it means people _are_ building pieces that suit their needs.

FWIW, I personally have made a major effort to add documentation and write tutorials on a lot of the more practical issues Redux users face. I wrote the FAQ [1] and "Structuring Reducers" [2] sections for the docs, and have been writing a blog series called "Practical Redux" [3] that's intended to demonstrate some intermediate to advanced concepts in the context of a sample app.

If you have any particular pain points that you feel the docs do not currently address very well, please file an issue or a PR. I'm ALWAYS happy to work with anyone who wants to improve the docs.

As for Redux vs MobX, Preethi Kasireddy's presentation today was a FANTASTIC comparison of the relative strengths, weaknesses, tradeoffs, and use cases for each of them. I highly recommend that people check it out as soon as the ReactConf recordings are posted online. Also, my React/Redux links list [4] has a section that links to several other good MobX/Redux comparisons as well [5].

[0] https://github.com/reactjs/redux/issues/775#issuecomment-257...

[1] http://redux.js.org/docs/FAQ.html

[2] http://redux.js.org/docs/recipes/StructuringReducers.html

[3] http://blog.isquaredsoftware.com/series/practical-redux

[4] https://github.com/markerikson/react-redux-links

[5] https://github.com/markerikson/react-redux-links/blob/master...