Skip to content

Commit afe0afb

Browse files
committed
feat(combineLatest): removed deprecated combineLatest operator
BREAKING CHANGE: The `combineLatest` operator is no longer available. Use `combineLatestWith`.
1 parent 1180f39 commit afe0afb

File tree

8 files changed

+12
-750
lines changed

8 files changed

+12
-750
lines changed

api_guard/dist/types/operators/index.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ export declare function catchError<T, O extends ObservableInput<any>>(selector:
2424

2525
export declare const combineAll: typeof combineLatestAll;
2626

27-
export declare function combineLatest<T, A extends readonly unknown[], R>(sources: [...ObservableInputTuple<A>], project: (...values: [T, ...A]) => R): OperatorFunction<T, R>;
28-
export declare function combineLatest<T, A extends readonly unknown[], R>(sources: [...ObservableInputTuple<A>]): OperatorFunction<T, [T, ...A]>;
29-
export declare function combineLatest<T, A extends readonly unknown[], R>(...sourcesAndProject: [...ObservableInputTuple<A>, (...values: [T, ...A]) => R]): OperatorFunction<T, R>;
30-
export declare function combineLatest<T, A extends readonly unknown[], R>(...sources: [...ObservableInputTuple<A>]): OperatorFunction<T, [T, ...A]>;
31-
3227
export declare function combineLatestAll<T>(): OperatorFunction<ObservableInput<T>, T[]>;
3328
export declare function combineLatestAll<T>(): OperatorFunction<any, T[]>;
3429
export declare function combineLatestAll<T, R>(project: (...values: T[]) => R): OperatorFunction<ObservableInput<T>, R>;

spec-dtslint/operators/combineLatest-spec.ts

-112
This file was deleted.

spec/Observable-spec.ts

+8-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect } from 'chai';
22
import * as sinon from 'sinon';
33
import { TeardownLogic } from '../src/internal/types';
44
import { Observable, config, Subscription, Subscriber, Operator, NEVER, Subject, of, throwError, EMPTY } from 'rxjs';
5-
import { map, multicast, refCount, filter, count, tap, combineLatest, concat, merge, race, zip, catchError, publish, publishLast, publishBehavior, share} from 'rxjs/operators';
5+
import { map, multicast, refCount, filter, count, tap, combineLatestWith, concat, merge, race, zip, catchError, publish, publishLast, publishBehavior, share} from 'rxjs/operators';
66
import { TestScheduler } from 'rxjs/testing';
77
import { observableMatcher } from './helpers/observableMatcher';
88

@@ -132,7 +132,7 @@ describe('Observable', () => {
132132
},
133133
(err) => {
134134
results.push(err);
135-
// The error should unsubscribe from the source, meaning we
135+
// The error should unsubscribe from the source, meaning we
136136
// should not see the number 4.
137137
expect(results).to.deep.equal([1, 2, 3, expected]);
138138
}
@@ -179,7 +179,7 @@ describe('Observable', () => {
179179
results.push(value);
180180
}
181181
next.bind = () => { /* lol */};
182-
182+
183183
const complete = function () {
184184
results.push('done');
185185
}
@@ -1051,13 +1051,16 @@ describe('Observable.lift', () => {
10511051
);
10521052
});
10531053

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

1060-
const result = MyCustomObservable.from(e1).pipe(combineLatest(e2, (a, b) => String(a) + String(b)));
1060+
const result = MyCustomObservable.from(e1).pipe(
1061+
combineLatestWith(e2),
1062+
map(([a, b]) => String(a) + String(b))
1063+
);
10611064

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

0 commit comments

Comments
 (0)