Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spec/operators/skipUntil-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '^ ! ';
Expand Down
4 changes: 3 additions & 1 deletion src/internal/operators/skipUntil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class SkipUntilSubscriber<T, R> extends OuterSubscriber<T, R> {
outerIndex: number, innerIndex: number,
innerSub: InnerSubscriber<T, R>): void {
this.hasValue = true;
this.innerSubscription.unsubscribe();
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();
}
}

notifyComplete() {
Expand Down