Skip to content

Bug: delayWhen operator returns an Observable that does not complete. #2587

@plul

Description

@plul

RxJS version:
5.3.0

Code to reproduce:

Rx.Observable.of('foo')
  .delayWhen(function() {
    return Rx.Observable.of('bar');
  })
  .subscribe({
    next: function(x) {
      console.log('next');
    },
    complete: function() {
      console.log('complete');
    }
  });

Expected behavior:
Output
'next'
'complete'

Actual behavior:
Output
'next'

Additional information:
If you substitute delayWhen(...) for say delay(1000) in the above, it will emit complete as expected.

Here is a jsFiddle using https://unpkg.com/rxjs/bundles/Rx.min.js showcasing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions