From 91801dd04ab28e7183808df27a0d85d3b0402f80 Mon Sep 17 00:00:00 2001 From: Clayton Lautier Date: Fri, 11 May 2018 12:06:52 +0200 Subject: [PATCH 1/3] fix(skipUntil): fix skipUntil when innerSubscription is null --- src/internal/operators/skipUntil.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal/operators/skipUntil.ts b/src/internal/operators/skipUntil.ts index 24f40ee350..5269f8944f 100644 --- a/src/internal/operators/skipUntil.ts +++ b/src/internal/operators/skipUntil.ts @@ -57,7 +57,9 @@ class SkipUntilSubscriber extends OuterSubscriber { outerIndex: number, innerIndex: number, innerSub: InnerSubscriber): void { this.hasValue = true; - this.innerSubscription.unsubscribe(); + if(this.innerSubscription) { + this.innerSubscription.unsubscribe(); + } } notifyComplete() { From 297a21f145b1bd0ae6666984d4cb0f8b301f2d0a Mon Sep 17 00:00:00 2001 From: Clayton Lautier Date: Fri, 11 May 2018 16:36:12 +0200 Subject: [PATCH 2/3] tests(skipUntil): which should emit for a synchronous notifier emits --- spec/operators/skipUntil-spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/operators/skipUntil-spec.ts b/spec/operators/skipUntil-spec.ts index 48e2752ddb..d8f06e3393 100644 --- a/spec/operators/skipUntil-spec.ts +++ b/spec/operators/skipUntil-spec.ts @@ -30,6 +30,16 @@ describe('skipUntil', () => { expectSubscriptions(skip.subscriptions).toBe(skipSubs); }); + it('should emit elements after a synchronous notifier emits', () => { + const values: string[] = []; + + of('a', 'b').pipe(skipUntil(of('x'))).subscribe( + value => values.push(value), + err => { throw err; }, + () => expect(values).to.deep.equal(['a', 'b']) + ); + }); + it('should raise an error if notifier throws and source is hot', () => { const e1 = hot('--a--b--c--d--e--|'); const e1subs = '^ ! '; From a36f7188a8d90565b29da2bec86a4097320e2ae3 Mon Sep 17 00:00:00 2001 From: Clayton Lautier Date: Tue, 15 May 2018 12:43:49 +0200 Subject: [PATCH 3/3] style: add space between if and brackets --- src/internal/operators/skipUntil.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/operators/skipUntil.ts b/src/internal/operators/skipUntil.ts index 5269f8944f..383847f97b 100644 --- a/src/internal/operators/skipUntil.ts +++ b/src/internal/operators/skipUntil.ts @@ -57,7 +57,7 @@ class SkipUntilSubscriber extends OuterSubscriber { outerIndex: number, innerIndex: number, innerSub: InnerSubscriber): void { this.hasValue = true; - if(this.innerSubscription) { + if (this.innerSubscription) { this.innerSubscription.unsubscribe(); } }