3 ms·
sagas are a steep learning curve and absolutely knowing what a generator function is essential before opening the docs. They are a very productive tool and wor
by binocarlos 10y ago
sagas are a steep learning curve and absolutely knowing what a generator function is essential before opening the docs. They are a very productive tool and worth the time imho.
They allow your redux containers to concentrate on selecting state and triggering actions and the async stuff stays out of the way in 'workers'.
Defo worth a look if your redux project has more than a few pages.
- adregan 10y agoI'm using redux-observables (very similar conceptually to sagas but uses rxjs) and allowing redux actions to remain pure and synchronous has made testing a breeze. Middleware has quickly become the most important redux feature for me.
- cnp 10y agoRedux saga is so elegant it makes me want to cry - but you have to understand generators first, as the author states. Once you get that part, then there's really no going back. Much simpler (and far lighter) than redux-observable.