Replies: 3 comments 1 reply
-
This is dupe of #5858 , as shared it explicitly states delay only works with source emits while your example is already completed | terminated synchronous source. |
Beta Was this translation helpful? Give feedback.
-
I also think that it would be nice to have the option of being able to apply the delay to completion and errors. A way to accomplish that -without triggering breaking changes- would be to add an overload to delay({
due: 1000,
next: true,
complete: true,
}) Meaning that something like The signature of this configuration object could be something like: interface DelayConfig {
due: number | Date,
next?: boolean,
complete?: boolean,
error?: boolean,
} And by default the value of I wouldn't mind sending a PR implementing this behavior if the core team agrees with this idea. |
Beta Was this translation helpful? Give feedback.
-
ref #6465 which describes related behaviors in other operators |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently ran into a small issue with
delay
operator: It doesn't work as I initially expected with completions.In my case I would've expected:
to complete after one second. But it completes synchronously.
I know this can be written using
timer
+ignoreElements
, but it feels inconsistent. Take this example:this one it does complete after 1 second. If the source emits any value before completing, then it waits the delay, emits the value and completes.
I've prepared a sandbox with a few examples, and I've also seen there's something which I think it could lead to unexpected behaviour, if the stream errors.
I kind of understand the reasoning of "the stream has blown up, you need to deal with it" for this one. But, this example:
Also errors synchronously without emitting any value, even though the values from (1..5) were emitted from the source, which I think it can be raised as unexpected.
Wouldn't it make more sense if it was consistent with all kinds of notifications (next, error, complete)? If I can raise this as a bug/feature request, should this be done for 8.x or can it be raised for 7.x?
Beta Was this translation helpful? Give feedback.
All reactions