Skip to content

Commit

Permalink
fix(bufferTime): correct bufferCreationInterval check for null
Browse files Browse the repository at this point in the history
  • Loading branch information
kwonoj committed Sep 18, 2016
1 parent e91d113 commit bc8be00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operator/bufferTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class BufferTimeSubscriber<T> extends Subscriber<T> {
private scheduler: Scheduler) {
super(destination);
const context = this.openContext();
this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
this.timespanOnly = bufferCreationInterval === null || bufferCreationInterval < 0;
if (this.timespanOnly) {
const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };
this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
Expand Down Expand Up @@ -168,13 +168,13 @@ class BufferTimeSubscriber<T> extends Subscriber<T> {
this.contexts = null;
}

protected onBufferFull(context: Context<T>) {
protected onBufferFull(context: Context<T>): void {
this.closeContext(context);
const closeAction = context.closeAction;
closeAction.unsubscribe();
this.remove(closeAction);

if (this.timespanOnly) {
if (this.timespanOnly && this.contexts !== null) {
context = this.openContext();
const bufferTimeSpan = this.bufferTimeSpan;
const timeSpanOnlyState = { subscriber: this, context, bufferTimeSpan };
Expand Down

0 comments on commit bc8be00

Please sign in to comment.