From 20ef7857c8e589656c5f2d60437c80208c5ea711 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Wed, 16 Sep 2015 01:54:21 -0700 Subject: [PATCH] fix(expand): Fix expand to stay open until the source Observable completes. --- spec/operators/expand-spec.js | 4 ++-- src/operators/expand.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/operators/expand-spec.js b/spec/operators/expand-spec.js index 6ca103432d..f18d5292e8 100644 --- a/spec/operators/expand-spec.js +++ b/spec/operators/expand-spec.js @@ -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?) ... @@ -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) { diff --git a/src/operators/expand.ts b/src/operators/expand.ts index ce7dfffa7f..3eabda846c 100644 --- a/src/operators/expand.ts +++ b/src/operators/expand.ts @@ -29,7 +29,7 @@ class ExpandOperator implements Operator { class ExpandSubscriber extends Subscriber { private index: number = 0; private active: number = 0; - private hasCompleted: boolean = true; + private hasCompleted: boolean = false; private buffer: T[]; constructor(destination: Observer, private project: (value: T, index: number) => Observable,