Skip to content

Commit

Permalink
fix(debounceTime): align value emit behavior as same as RxJS4
Browse files Browse the repository at this point in the history
due to current null check, debounceTime does not allow value
to be undefined. This change updates behavior to align behavior
as same as RxJS4 does.

closes ReactiveX#1081
  • Loading branch information
kwonoj committed Dec 16, 2015
1 parent 6303558 commit 4e3ce34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/operator/debounceTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DebounceTimeOperator<T, R> implements Operator<T, R> {

class DebounceTimeSubscriber<T> extends Subscriber<T> {
private debouncedSubscription: Subscription<any> = null;
private lastValue: any = null;
private lastValue: T = null;

constructor(destination: Subscriber<T>,
private dueTime: number,
Expand All @@ -41,7 +41,8 @@ class DebounceTimeSubscriber<T> extends Subscriber<T> {

debouncedNext(): void {
this.clearDebounce();
if (this.lastValue != null) {

if (this.lastValue !== null) {
this.destination.next(this.lastValue);
this.lastValue = null;
}
Expand Down

0 comments on commit 4e3ce34

Please sign in to comment.