Skip to content

Commit

Permalink
Fix faulty pause/resume logic in PausableObservable and PausableBuffe…
Browse files Browse the repository at this point in the history
…redObservable
  • Loading branch information
urmastalimaa committed Aug 29, 2014
1 parent 8c15263 commit 942fd22
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/core/backpressure/pausable.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,14 @@
function PausableObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}

PausableObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};

PausableObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};

Expand Down
9 changes: 0 additions & 9 deletions src/core/backpressure/pausablebuffered.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,14 @@
function PausableBufferedObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}

PausableBufferedObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};

PausableBufferedObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};

Expand Down

0 comments on commit 942fd22

Please sign in to comment.