title: How to fire periodic actions using setTimeout and dispatcher in redux
body: <p>How/Where can I dispatch actions periodically? Using recursive <code>setTimeout</code> to make a countdown.</p>
  
  <p>Taken from the example, something similar to this:</p>
  
  <pre><code>// Can also be async if you return a function
  export function incrementAsync() {
    return dispatch =&gt; {
      (function _r() {
        setTimeout(() =&gt; {
          // Yay! Can invoke sync or async actions with `dispatch`
          dispatch(increment());
          _r();
        }, 1000);
      })();
    };
  }
  </code></pre>
  
  <p>So is this a good idea, or there is a better approach to this problem, like using middlewares or creating actions from somewhere else?</p>
  
  <p>I prefer a generic version of this, where I can control start/stop of the timer via the store.</p>
  
  <p>I've setup a sample implementation please take a look at <a href="https://gist.github.com/eguneys/7023a114558b92fdd25e">https://gist.github.com/eguneys/7023a114558b92fdd25e</a></p>