Skip to content

Commit

Permalink
fix(combineLatest): emit unique array instances with the default proj…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
Mark Buer committed Aug 1, 2016
1 parent 897fe3b commit 2e30fd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions spec/operators/combineLatest-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,4 +461,14 @@ describe('Observable.prototype.combineLatest', () => {
expectSubscriptions(e1.subscriptions).toBe(e1subs);
expectSubscriptions(e2.subscriptions).toBe(e2subs);
});

it('should emit unique array instances with the default projection', () => {
const e1 = hot('-a--b--|');
const e2 = hot('--1--2-|');
const expected = '-------(c|)';

const result = e1.combineLatest(e2).distinct().count();

expectObservable(result).toBe(expected, { c: 3 });
});
});
2 changes: 1 addition & 1 deletion src/operator/combineLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export class CombineLatestSubscriber<T, R> extends OuterSubscriber<T, R> {
if (this.project) {
this._tryProject(values);
} else {
this.destination.next(values);
this.destination.next(values.slice());
}
}
}
Expand Down

0 comments on commit 2e30fd1

Please sign in to comment.