3 ms·
In addition to redux-saga (https://github.com/yelouafi/redux-saga https://github.com/yelouafi/redux-saga) which others have mentioned, redux-loop (https://githu
by emilong 11y ago
In addition to redux-saga (https://github.com/yelouafi/redux-saga https://github.com/yelouafi/redux-saga) which others have mentioned, redux-loop (https://github.com/raisemarketplace/redux-loop https://github.com/raisemarketplace/redux-loop) is another interesting "declarative" approach to sequencing operations that uses promises. I'm not using either (yet), but I wrote up my notes on the differences between them and the thunk middleware approach recently (https://blog.boldlisting.com/connecting-redux-to-your-api-eac51ad9ff89#.79d5lnivt https://blog.boldlisting.com/connecting-redux-to-your-api-ea...). One aspect of these discussions that I find is lost or at least very implicit is the notion of storing metadata about the status of async operations as well as their result is elided together, but there's reason to make mindful choices about whether or not to do that.
BTW, the "Ignoring Async Responses" section here is a useful pattern, even if you're not working on browser developer tools ;). I've been working on a web app and have a polling timeout that I cancel on logout. Not quite the same, but logout triggers a reset of all the state obtained while authenticated, but the timeout ids are also in the store and canceled before being cleared.