Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delayWhen operator doesn't delay the events if delayDurationSelector returns a Subject. #5318

Closed
EarthyOrange opened this issue Feb 16, 2020 · 3 comments

Comments

@EarthyOrange
Copy link

EarthyOrange commented Feb 16, 2020

Bug Report

Current Behavior
The delayWhen operator doesn't delay the events if delayDurationSelector returns a Subject.

Reproduction

Expected behavior
In the reproducible example, values 1-4 should not be printed.

Environment

  • RxJS version: ^6.5.1
@EarthyOrange EarthyOrange changed the title delayWhen delayWhen operator doesn't delay the events if delayDurationSelector returns a Subject. Feb 16, 2020
@cartant
Copy link
Collaborator

cartant commented Feb 16, 2020

It's because the subject - that you are using as the notifier - completes. The implementation of delayWhen does not delay if the notifier completes. There is some discussion here relating to this.

I've edited that issue's title to better reflect the problem. Fixing this bug will be a breaking change that we can introduce in version 7.

@cartant
Copy link
Collaborator

cartant commented Feb 17, 2020

Closing this as a dupe of #3665, as I've had a play with the repro and if the take - that's applied to the observable to which the subject is subscribed - is bumped to, say, 100, the delay is applied. So this is the same problem as in the above issue - the subject completes when the take completes its source.

@cartant cartant closed this as completed Feb 17, 2020
@EarthyOrange
Copy link
Author

Thank you for looking in to it so quickly!!

@lock lock bot locked as resolved and limited conversation to collaborators Mar 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants