Skip to content

Commit

Permalink
docs(delayWhen): Deprecate completion of notifier triggering source e…
Browse files Browse the repository at this point in the history
…mission

This deprecates the behavior that the completion of the notifier observable will cause the source
emission to be emitted on the output observable.
  • Loading branch information
Airblader committed May 21, 2018
1 parent d140498 commit cc1cc71
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/internal/operators/delayWhen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { MonoTypeOperatorFunction, TeardownLogic } from '../types';
* argument, and should return an Observable, called the "duration" Observable.
* The source value is emitted on the output Observable only when the duration
* Observable emits a value or completes.
* The completion of the notifier triggering the emission of the source value
* is deprecated behavior and will be removed in future versions.
*
* Optionally, `delayWhen` takes a second argument, `subscriptionDelay`, which
* is an Observable. When `subscriptionDelay` emits its first value or
Expand Down Expand Up @@ -62,6 +64,10 @@ export function delayWhen<T>(delayDurationSelector: (value: T) => Observable<any
return (source: Observable<T>) => source.lift(new DelayWhenOperator(delayDurationSelector));
}

/** @deprecated In future versions, empty notifiers will no longer re-emit the source value on the output observable. */
export function delayWhen<T>(delayDurationSelector: (value: T) => Observable<never>,
subscriptionDelay?: Observable<any>): MonoTypeOperatorFunction<T>;

class DelayWhenOperator<T> implements Operator<T, T> {
constructor(private delayDurationSelector: (value: T) => Observable<any>) {
}
Expand Down

0 comments on commit cc1cc71

Please sign in to comment.