4 ms·
I've been thinking about different situations in which Redux could be replaced with the new Context. Id sure appreciate having to write less boilerplate. The bi
by jdpigeon 9y ago
I've been thinking about different situations in which Redux could be replaced with the new Context. Id sure appreciate having to write less boilerplate. The biggest concern I always get stuck on is where I'll put all my app's business logic, which I'm so used to putting in async redux-observable or redux-thunk actions. Does anyone have anything ideas on how to make an elegant business-logic-full Provider component?
- acemarke 9y agoI put up a post today called "Redux - Not Dead Yet!" [0], where I responded to recent comments claiming that the new context API will replace Redux. (Answer: maybe, if all you need is just passing down data to deeply nested components.) As for the "boilerplate" topic: you are encouraged to use as little or as much abstraction on top of Redux as you want, whether it be small utility functions or entire other frameworks that wrap Redux. We've got a "Reducing Boilerplate" page in the docs [1], and I've got a section of my React/Redux links list for articles on that topic [2]. I'd be happy to suggest possible solutions for whatever problems you're concerned about. [0] http://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet/ http://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet/ [1] https://redux.js.org/recipes/reducing-boilerplate https://redux.js.org/recipes/reducing-boilerplate [2] https://github.com/markerikson/react-redux-links/blob/master/redux-techniques.md#reducing-boilerplate https://github.com/markerikson/react-redux-links/blob/master...
- bcherny 9y agoIf you want less boilerplate and type safety, consider Undux - https://github.com/bcherny/undux https://github.com/bcherny/undux