I'm stuck with Throttle
publisher. I don't understand the way it picks intervals. Debounce
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 Throttle
examples even from Apple, but they are very very simple.
Let's say we have some upstream which produces values and we know when all the values were produced (input: [Time]
). Throttle
publisher consumes these values, throttles them and produces values at some other times (output: [Time]
). Is there a way to write a function which produces the correct expected output
?
func output<Time>(interval: Time, input: [Time]) -> [Time] {
//
}
Btw, I believe latest
parameter doesn't play any role while picking the interval, does it? I belive it just picks values from intervals provided.