3 ms·
Those libs add some "magic" which is going against the point of Redux (knowing exactly what's going on). Instead of those abstraction libs I like to use the obs
by msoad 8y ago
Those libs add some "magic" which is going against the point of Redux (knowing exactly what's going on). Instead of those abstraction libs I like to use the observable pattern with Rx or MobX
- acemarke 8y agoDepends on what your definition of "magic" is. For example, we specifically have a "Reducing Boilerplate" docs page [0] that talks about writing reusable logic for reducers and action creators, like "higher order reducers" or a `createReducer()` util that accepts a lookup table of action types to handler functions. There's many existing libs that implement this kind of pattern [1]. Beyond that, there's other libraries that provide a higher level of abstraction, like automatically generating logic to handle common use cases (normalizing data, updating certain fields, etc) [2]. Updating data immutably can become complex [3], so there's a lot of immutable update utility libraries out there [4]. I recommend Immer [5], which lets you write normal mutative code but then applies the updates immutably. Finally, there's frameworks built on top of Redux, like Kea and Rematch [6]. So, plenty of options available, depending on what you're comfortable with. [0] https://redux.js.org/recipes/reducing-boilerplate https://redux.js.org/recipes/reducing-boilerplate [1] https://github.com/markerikson/redux-ecosystem-links/blob/master/action-reducer-generators.md https://github.com/markerikson/redux-ecosystem-links/blob/ma... [2] https://github.com/TheComfyChair/redux-scc https://github.com/TheComfyChair/redux-scc , https://github.com/Bloomca/redux-tiles https://github.com/Bloomca/redux-tiles [3] https://redux.js.org/recipes/structuring-reducers/immutable-update-patterns https://redux.js.org/recipes/structuring-reducers/immutable-... [4] https://github.com/markerikson/redux-ecosystem-links/blob/master/immutable-data.md#immutable-update-utilities https://github.com/markerikson/redux-ecosystem-links/blob/ma... [5] https://github.com/mweststrate/immer https://github.com/mweststrate/immer [6] https://github.com/keajs/kea https://github.com/keajs/kea , https://github.com/rematch/rematch https://github.com/rematch/rematch