Before lettable operators, the code looked like this:
get someData$(): Observable<Data> {
return this.dataService.higherOrderDataStream
.mergeAll()
.map(...);
}
Refactoring to use pipe
, I get a type error essentially saying Observable<Observable<Data>>
is not assignable to type Observable<Data>
:
get someData$(): Observable<Data> {
return this.dataService.higherOrderDataStream
.pipe(
mergeAll(),
map(...)
);
}
But the following works just fine (I assume one shouldn't mix lettable and chained operators):
get someData$(): Observable<Data> {
return this.dataService.higherOrderDataStream
.mergeAll()
.pipe(
map(...)
);
}
Is there a different mergeAll
I should be using? I'm using the one from rxjs/operators
where I was using rxjs/add/operator/mergeAll
previously. I thought these two implementations would be equivalent.
Is this a bug or am I using the new mergeAll
incorrectly?