Skip to content

delayWhen doesn't emit when the duration selector is empty() #3663

@Airblader

Description

@Airblader

RxJS version: 6.1.0

Code to reproduce:

of(42).pipe(delayWhen(() => empty()))
  .subscribe(console.log);

Expected behavior:

This should log 42 immediately, as empty completes immediately which according to the docs should suffice even if the duration selector doesn't emit:

The source value is emitted on the output Observable only when the duration Observable emits a value or completes.

Actual behavior:

The observable completes without emission.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions