Skip to content

Commit

Permalink
fix(takeUntil): complete an observable when notifier completes
Browse files Browse the repository at this point in the history
Closes #2160
  • Loading branch information
DzmitryShylovich committed Apr 3, 2017
1 parent bc1e1e5 commit 7eb7aa2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions spec/operators/takeUntil-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ describe('Observable.prototype.takeUntil', () => {
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});

it('should take all values when notifier is empty', () => {
it('should take values until notifier completes', () => {
const e1 = hot('--a--b--c--d--e--f--g--|');
const e1subs = '^ !';
const e1subs = '^ ! ';
const e2 = hot('-------------| ');
const e2subs = '^ ! ';
const expected = '--a--b--c--d--e--f--g--|';
const expected = '--a--b--c--d-| ';

expectObservable(e1.takeUntil(e2)).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
Expand Down Expand Up @@ -96,12 +96,12 @@ describe('Observable.prototype.takeUntil', () => {
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});

it('should not complete when notifier is empty if source observable does not complete', () => {
it('should complete when notifier is empty even if source observable does not complete', () => {
const e1 = hot('-');
const e1subs = '^';
const e1subs = '^ !';
const e2 = hot('--|');
const e2subs = '^ !';
const expected = '---';
const expected = '--|';

expectObservable(e1.takeUntil(e2)).toBe(expected);
expectSubscriptions(e1.subscriptions).toBe(e1subs);
Expand Down
2 changes: 1 addition & 1 deletion src/operator/takeUntil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ class TakeUntilSubscriber<T, R> extends OuterSubscriber<T, R> {
}

notifyComplete(): void {
// noop
this.complete();
}
}

0 comments on commit 7eb7aa2

Please sign in to comment.