How to fire periodic actions using setTimeout and dispatcher in redux
问题 How/Where can I dispatch actions periodically? Using recursive setTimeout to make a countdown. Taken from the example, something similar to this: // Can also be async if you return a function export function incrementAsync() { return dispatch => { (function _r() { setTimeout(() => { // Yay! Can invoke sync or async actions with `dispatch` dispatch(increment()); _r(); }, 1000); })(); }; } So is this a good idea, or there is a better approach to this problem, like using middlewares or creating