title: setInterval callback function is not dynamic (Redux props)
body: <p>I have a simple js <code>setInterval</code>, where my callback is simply checking some <code>Redux</code> variable:</p>
  <pre><code>setInterval(() =&gt; {
      console.log(props.myStateVariable);
  }, 5000);
  </code></pre>
  <p>The problem is that it just prints whatever the variable was at the time of this <code>setInterval</code>'s instantiation. How to make it dynamic? Thanks</p>
  <p><strong>edit</strong></p>
  <p>And what if this <code>myStateVariable</code> is a string variable of a long, editable text, so I'd rather not re-set this timeout every time someone types a letter?</p>