Skip to content

Commit

Permalink
fix(expand): Fix expand to stay open until the source Observable comp…
Browse files Browse the repository at this point in the history
…letes.
  • Loading branch information
trxcllnt authored and benlesh committed Sep 17, 2015
1 parent 4ad6797 commit 20ef785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/operators/expand-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Observable.prototype.expand()', function () {
d: 4 + 4, // c + c,
e: 8 + 8, // d + d
}
var e1 = hot('a', values);
var e1 = hot('(a|)', values);
/*
expectation explanation: (conjunction junction?) ...
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('Observable.prototype.expand()', function () {
d: 4 + 4, // c + c,
e: 8 + 8, // d + d
}
var e1 = hot('a', values);
var e1 = hot('(a|)', values);
var expected = '(abcde|)';

expectObservable(e1.expand(function(x) {
Expand Down
2 changes: 1 addition & 1 deletion src/operators/expand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ExpandOperator<T, R> implements Operator<T, R> {
class ExpandSubscriber<T, R> extends Subscriber<T> {
private index: number = 0;
private active: number = 0;
private hasCompleted: boolean = true;
private hasCompleted: boolean = false;
private buffer: T[];

constructor(destination: Observer<T>, private project: (value: T, index: number) => Observable<R>,
Expand Down

0 comments on commit 20ef785

Please sign in to comment.