Incorrect type signatures for concatAll and mergeAll operators
See original GitHub issueRxJS version: 5.4.2
Code to reproduce:
const fromEvent = Rx.Observable.fromEvent;
const mouseEvents = Rx.Observable.of([fromEvent(document, "click"), fromEvent(document, "mouseenter"), fromEvent(document, "mouseleave")]);
mouseEvents.concatAll().mapTo(null);
mouseEvents.mergeAll().mapTo(null);
Expected behavior: Code compiles without error.
Actual behavior: Type error: "[ts] Property ‘mapTo’ does not exist on type ‘Observable<{}>[]’.
Additional information: Incorrect type signatures are-
function concatAll<T>(this: Observable<T>): T;
function concatAll<T, R>(this: Observable<T>): Subscribable<R>;
function mergeAll<T>(this: Observable<T>, concurrent?: number): T;
function mergeAll<T, R>(this: Observable<T>, concurrent?: number): Subscribable<R>;
They should be (I believe):
function concatAll<T extends ObservableInput<R>, R>(this: Observable<T>): Observable<R>;
function mergeAll<T extends ObservableInput<R>, R>(this: Observable<T>, concurrent?: number): Observable<R>;
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
concatAll - Learn RxJS
signature : concatAll(): Observable ... Example 1: concatAll with observable ... import { map, concatAll } from 'rxjs/operators';.
Read more >RxJs custom operator with function as input - Stack Overflow
You'll need a function of type (input: T) => Observable<R> . Which is the same type signature that concatMap already takes.
Read more >RxJs combination operators - Medium
RxJs combination operators · CombineAll — · ConcatAll — · MergeAll — · Learn to combine RxJs sequences with super intuitive interactive diagrams...
Read more >RxJS 6.x to 7.x Detailed Change List
The kind property is now readonly . The value property is now readonly and may be undefined . constructor signature now only allows...
Read more >rxjs/CHANGELOG.md - UNPKG
522, - Type signatures tightened up around `Notification` and `dematerialize`, may uncover issues with invalid types passed to those operators.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Closed by #3321
Can we please fix this without waiting for a major release? This is an active issue, with two separate PRs to (partially) fix it on master in the last month: #2779, #2760
The existing typings for
mergeAll()are wrong and unusable. It should be trivial to drop in the correct typing from #2779: https://github.com/ReactiveX/rxjs/pull/2690/files#diff-287d1762ff7b138d92ddcb79627353f7