question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipeable concatAll and mergeAll types broken

See original GitHub issue

RxJS version: 5.5.6 Code to reproduce:

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import 'rxjs/add/operator/concatAll';
import { concatAll } from 'rxjs/operators/concatAll';
import 'rxjs/add/operator/mergeAll';
import { mergeAll } from 'rxjs/operators/mergeAll';
import 'rxjs/add/operator/switch';
import { switchAll } from 'rxjs/operators/switchAll';

const prototypeConcatAll: Observable<number> = of(of(1)).concatAll();
const pipeableConcatAll: Observable<number> = of(of(1)).pipe(concatAll()); // Observable<Observable<number>> is not assignable to type Observable<number>

const prototypeMergeAll: Observable<number> = of(of(1)).mergeAll();
const pipeableMergeAll: Observable<number> = of(of(1)).pipe(mergeAll());// Observable<Observable<number>> is not assignable to type Observable<number>

const prototypeSwitchAll: Observable<number> = of(of(1)).switch();
const pipeableSwitchAll: Observable<number> = of(of(1)).pipe(switchAll());

Expected behavior: concatAll and mergeAll pipeable operators transform type Observable<T> > T the same as the prototype operators.

Actual behavior: concatAll and mergeAll pass types through Observable<T> > Observable<t>.

Additional information: While concatAll and mergeAllare misbehaving, switchAll is working as expected.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mlegenhausencommented, Feb 12, 2018
declare module 'rxjs/operators/mergeAll' {
  import { UnaryFunction } from 'rxjs/interfaces';
  import { Observable } from 'rxjs/Observable';
  export function mergeAll<T>(concurrent?: number): UnaryFunction<Observable<T>, T>;
}

This can be added to a typings.d.ts if you just want to the types to be fixed instead of reexporting the whole function. The same should work for concatAll.

0reactions
lock[bot]commented, Jun 5, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RxJS Operators
Operators are functions. There are two kinds of operators: Pipeable Operators are the kind that can be piped to Observables using the syntax...
Read more >
RxJS mergeMap() with original order - Stack Overflow
It calls shipOrder for each value immediately (so subsequent values may start parallel requests). The second operator, concatAll, puts the ...
Read more >
concatAll - Learn RxJS
Collect observables and subscribe to next when previous completes. ; ⚠ Be wary of backpressure when the source emits at a faster pace...
Read more >
@reactivex/rxjs | Yarn - Package Manager
types: Resolved an issue where referencing Symbol.observable before RxJS accessed the symbol/observable module internally would result in a reference error.
Read more >
Everything You Need to Know About RxJS - Morioh
3 - Operators. Operators are functions of two types in RxJS: Creation or Pipeable. ... import { interval, timer } from 'rxjs'; import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found