4 ms·
Sagas are a great power tool, but I personally wouldn't use them for most simple API requests, largely because of the need for "signal actions" to trigger the l
by acemarke 8y ago
Sagas are a great power tool, but I personally wouldn't use them for most simple API requests, largely because of the need for "signal actions" to trigger the logic.
You might want to check out our new `redux-starter-kit` package [0], which can simplify some common use cases for things like action creators and reducers. There's also many other existing libraries to handle repetitive code like API requests as well [1].
[0] https://github.com/reduxjs/redux-starter-kit https://github.com/reduxjs/redux-starter-kit
[1] https://github.com/markerikson/redux-ecosystem-links/blob/master/action-reducer-generators.md https://github.com/markerikson/redux-ecosystem-links/blob/ma... , https://github.com/markerikson/redux-ecosystem-links/blob/master/entity-collection-management.md https://github.com/markerikson/redux-ecosystem-links/blob/ma...
- Aeolun 8y agoI think you need to use sagas for either all your logic, or none of it. Having it half/half just means you’re always searching for where something is located. That said, thanks for the recommendations! I’ll check them out.
- acemarke 8y agoFWIW, I use sagas _and_ thunks in my own app, depending on what it is I need to do. Also related, the new Redux FAQ entry on choosing between async middlewares: https://redux.js.org/faq/actions#what-async-middleware-should-i-use-how-do-you-decide-between-thunks-sagas-observables-or-something-else https://redux.js.org/faq/actions#what-async-middleware-shoul...