Closed xtianjohns closed 6 years ago
Looks good, @xtianjohns, but could you use the special object NO
instead of null
? Otherwise a stream that emits nulls (I use these sometimes) could not be correctly debounced.
🤦♂️ It really has been awhile since I've worked on this - good catch @staltz.
Also, let's hold off on a merge even if CI goes green, Travis failed for buffer (extra) should not emit empty buffers
, but locally I've had two successes and one failure for sampleCombine (extra) should complete only when the sample stream has completed
, and never the failure from Travis.
Dunno why I'm seeing flaky behavior, but I'm gonna try to puzzle it out.
Thanks!
Emit any pending value, then complete, if a source stream completes before a debounce interval closes.
Description
In order to be able to emit the latest value upon completion, the operator needs access to the most recent value. In the previous implementation, the emission took place in a closure created by
setTimeout
, so now the operator has a new propertyt
which keeps track of this emission.This value is cleared when the debounce interval closes and upon completion.
Resolve #257. Probably should close #127.