Skip to content

Commit

Permalink
fix(windowToggle): don't signal on complete
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Oct 27, 2020
1 parent 0f7ed01 commit 66a8b05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions spec/operators/windowToggle-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ describe('windowToggle', () => {
const subs = '^ !';
const e2 = cold( '----w--------w--------w--|');
const e2subs = '^ !';
const e3 = cold( '-----| ');
// -----(c|)
// -----(c|)
const e3 = cold( '-----x ');
// -----x
// -----x
const e3subs = [ ' ^ ! ', // eslint-disable-line array-bracket-spacing
' ^ ! ',
' ^ !'];
Expand Down Expand Up @@ -121,17 +121,17 @@ describe('windowToggle', () => {
expectSubscriptions(closings[2].obs.subscriptions).toBe(closings[2].sub);
});

it('should emit windows using constying empty delayed closings', () => {
it('should emit windows using varying empty delayed closings', () => {
const e1 = hot('--a--^---b---c---d---e---f---g---h------| ');
const e1subs = '^ ! ';
const e2 = cold('--x-----------y--------z---| ');
const e2subs = '^ ! ';
const close = [cold( '---------------| '),
cold( '----| '),
cold( '---------------|')];
cold( '----| '),
cold( '---------------|')];
const expected = '--x-----------y--------z-----------| ';
const x = cold( '--b---c---d---e| ');
const y = cold( '--e-| ');
const x = cold( '--b---c---d---e---f---g---h------| ');
const y = cold( '--e---f---g---h------| ');
const z = cold( '-g---h------| ');
const values = { x, y, z };

Expand Down Expand Up @@ -419,8 +419,8 @@ describe('windowToggle', () => {
const e2subs = '^ ! ';
const e3 = EMPTY;
const expected = '---x---------------y---------------|';
const x = cold( '|');
const y = cold( '|');
const x = cold( '-b---c---d---e---f---g---h------|');
const y = cold( '-f---g---h------|');
const values = { x, y };

const result = e1.pipe(windowToggle(e2, () => e3));
Expand Down
2 changes: 1 addition & 1 deletion src/internal/operators/windowToggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export function windowToggle<T, O>(

subscriber.next(window.asObservable());

closingSubscription.add(closingNotifier.subscribe(new OperatorSubscriber(subscriber, closeWindow, handleError, closeWindow)));
closingSubscription.add(closingNotifier.subscribe(new OperatorSubscriber(subscriber, closeWindow, handleError, noop)));
},
undefined,
noop
Expand Down

0 comments on commit 66a8b05

Please sign in to comment.