title: How to use the cancel function in redux "timeoutScheduler" middleware docs example?
body: <p>When I implement the MW it works great but how do I invoke the "cancel" function
  if I want to clear the timeout?
  Here's is the code:(<a href="https://redux.js.org/advanced/middleware#seven-examples" rel="nofollow noreferrer">taken from Redux middleware</a>) </p>
  
  <pre><code>   /**
   * Schedules actions with { meta: { delay: N } } to be delayed by N milliseconds.
   * Makes `dispatch` return a function to cancel the timeout in this case.
   */
  const timeoutScheduler = store =&gt; next =&gt; action =&gt; {
    if (!action.meta || !action.meta.delay) {
      return next(action)
    }
  ​
    const timeoutId = setTimeout(
      () =&gt; next(action),
      action.meta.delay
    )
  ​
    return function cancel() {
      clearTimeout(timeoutId)
    }
  }
  </code></pre>