Closed loreanvictor closed 3 years ago
hi @loreanvictor ,
Thanks for a very complete and comprehensive report. Deeply sorry for my lack of reply. But I decided to implement this fix.
I choose your second alternative, I though it made a lot of sense (do not delay the last value more and send the termination signal along with it).
This is released with version 4.0.0
already published on NPM.
Thanks again š
I suspect this issue is related to #2 , but since that thread is specifically about supporting pullables, I thought perhaps a separate issue would do better.
The Issue
Last emitted value is not flushed. Basically the completion signal masks the last value received.
Example
In this example, nothing is logged.
playground
Proposed Behavior
I could think of two alternatives:
š debounce wait is 2. B is emitted 2 units after completion signal, alongside completion signal. e.g., the timeout is reset because of completion signal, but last value is also emitted.
I: -----(A)----- | ----- | -----(B)----- X O: ----- | ----- | -----(A)----- | ----- | -----(B) X
š debounce wait is 2. B is emitted 2 units after source emits B, alongside completion signal. e.g. the timeout is not reset because of completion signal, but it will be emitted alongside last value.
Which does not work with current implementation and would need a separate, delay only operator. It would be much more intuitive if you would not need to change the used operator for debouncing between these two situations.