Skip to content

Commit

Permalink
feat(combineLatest): removed deprecated combineLatest operator
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The `combineLatest` operator is no longer available. Use `combineLatestWith`.
  • Loading branch information
demensky committed Jun 26, 2022
1 parent 89b4a12 commit 7f10009
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 750 deletions.
5 changes: 0 additions & 5 deletions api_guard/dist/types/operators/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export declare function catchError<T, O extends ObservableInput<any>>(selector:

export declare const combineAll: typeof combineLatestAll;

export declare function combineLatest<T, A extends readonly unknown[], R>(sources: [...ObservableInputTuple<A>], project: (...values: [T, ...A]) => R): OperatorFunction<T, R>;
export declare function combineLatest<T, A extends readonly unknown[], R>(sources: [...ObservableInputTuple<A>]): OperatorFunction<T, [T, ...A]>;
export declare function combineLatest<T, A extends readonly unknown[], R>(...sourcesAndProject: [...ObservableInputTuple<A>, (...values: [T, ...A]) => R]): OperatorFunction<T, R>;
export declare function combineLatest<T, A extends readonly unknown[], R>(...sources: [...ObservableInputTuple<A>]): OperatorFunction<T, [T, ...A]>;

export declare function combineLatestAll<T>(): OperatorFunction<ObservableInput<T>, T[]>;
export declare function combineLatestAll<T>(): OperatorFunction<any, T[]>;
export declare function combineLatestAll<T, R>(project: (...values: T[]) => R): OperatorFunction<ObservableInput<T>, R>;
Expand Down
112 changes: 0 additions & 112 deletions spec-dtslint/operators/combineLatest-spec.ts

This file was deleted.

13 changes: 8 additions & 5 deletions spec/Observable-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import * as sinon from 'sinon';
import { TeardownLogic } from '../src/internal/types';
import { Observable, config, Subscription, Subscriber, Operator, NEVER, Subject, of, throwError, EMPTY } from 'rxjs';
import { map, multicast, refCount, filter, count, tap, combineLatest, concat, merge, race, zip, catchError, publish, publishLast, publishBehavior, share} from 'rxjs/operators';
import { map, multicast, refCount, filter, count, tap, combineLatestWith, concat, merge, race, zip, catchError, publish, publishLast, publishBehavior, share} from 'rxjs/operators';
import { TestScheduler } from 'rxjs/testing';
import { observableMatcher } from './helpers/observableMatcher';

Expand Down Expand Up @@ -132,7 +132,7 @@ describe('Observable', () => {
},
(err) => {
results.push(err);
// The error should unsubscribe from the source, meaning we
// The error should unsubscribe from the source, meaning we
// should not see the number 4.
expect(results).to.deep.equal([1, 2, 3, expected]);
}
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('Observable', () => {
results.push(value);
}
next.bind = () => { /* lol */};

const complete = function () {
results.push('done');
}
Expand Down Expand Up @@ -1051,13 +1051,16 @@ describe('Observable.lift', () => {
);
});

it('should compose through combineLatest', () => {
it('should compose through combineLatestWith', () => {
rxTestScheduler.run(({ cold, expectObservable }) => {
const e1 = cold(' -a--b-----c-d-e-|');
const e2 = cold(' --1--2-3-4---| ');
const expected = '--A-BC-D-EF-G-H-|';

const result = MyCustomObservable.from(e1).pipe(combineLatest(e2, (a, b) => String(a) + String(b)));
const result = MyCustomObservable.from(e1).pipe(
combineLatestWith(e2),
map(([a, b]) => String(a) + String(b))
);

expect(result instanceof MyCustomObservable).to.be.true;

Expand Down
Loading

0 comments on commit 7f10009

Please sign in to comment.