title: How does the Throttle publisher work in Swift Combine?
body: <p>I'm stuck with <a href="https://developer.apple.com/documentation/combine/publishers/throttle" rel="nofollow noreferrer"><code>Throttle</code></a> publisher. I don't understand the way it picks intervals. <a href="https://developer.apple.com/documentation/combine/publishers/debounce" rel="nofollow noreferrer"><code>Debounce</code></a> publisher is much easier to understand, it picks an interval after each published value and checks whether new values are posted during the interval or not. I've seen some <code>Throttle</code> examples even <a href="https://developer.apple.com/documentation/combine/future/throttle(for:scheduler:latest:)" rel="nofollow noreferrer">from Apple</a>, but they are very very simple.</p>
  <p>Let's say we have some upstream which produces values and we know when all the values were produced (<code>input: [Time]</code>). <code>Throttle</code> publisher consumes these values, throttles them and produces values at some other times (<code>output: [Time]</code>). Is there a way to write a function which produces the correct expected <code>output</code>?</p>
  <pre class="lang-swift prettyprint-override"><code>func output&lt;Time&gt;(interval: Time, input: [Time]) -&gt; [Time] {
    //
  }
  </code></pre>
  <p>Btw, I believe <code>latest</code> parameter doesn't play any role while picking the interval, does it? I belive it just picks values from intervals provided.</p>