diff --git a/spec/operators/combineLatest-spec.ts b/spec/operators/combineLatest-spec.ts index 84be6c14e2..32efce1e5e 100644 --- a/spec/operators/combineLatest-spec.ts +++ b/spec/operators/combineLatest-spec.ts @@ -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 }); + }); }); diff --git a/src/operator/combineLatest.ts b/src/operator/combineLatest.ts index fe29cd1883..fcbda0e8b4 100644 --- a/src/operator/combineLatest.ts +++ b/src/operator/combineLatest.ts @@ -150,7 +150,7 @@ export class CombineLatestSubscriber extends OuterSubscriber { if (this.project) { this._tryProject(values); } else { - this.destination.next(values); + this.destination.next(values.slice()); } } }