Re:Responsible JavaScript: Part I
by s_y_n_t_a_x on Monday April 15, 2019 @11:28AM
(#19666002)
The alternative is side-effects. Pick your poison, redux-sagas, redux-thunk, etc.
I prefer redux-sagas because generators fit the bill perfectly, and they test easy, and I'm not a huge fan of Observables.
The components dispatch an action, and the heavy-lifting is done by the side-effects library that listens for that action, and does any API calls, as well as dispatching any more actions.
I prefer redux-sagas because generators fit the bill perfectly, and they test easy, and I'm not a huge fan of Observables.
The components dispatch an action, and the heavy-lifting is done by the side-effects library that listens for that action, and does any API calls, as well as dispatching any more actions.