lettable toPromise?
See original GitHub issueRxJS version: 5.5.0-beta
Code to reproduce:
import { of } from "rxjs/observable/of";
import {
map,
toPromise
} from "rxjs/operators";
export function demoFn(): Promise<void> {
return of([null])
.pipe(
map(() => {}),
toPromise()
);
}
Expected behavior: No error Actual behavior:
Error:(11, 4) TS2345: Argument of type 'UnaryFunction<Observable<void>, Promise<void>>' is not assignable to parameter of type 'UnaryFunction<Observable<void>, Observable<{}>>'.
Type 'Promise<void>' is not assignable to type 'Observable<{}>'.
Property '_isScalar' is missing in type 'Promise<void>'.
Additional information:
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
RxJS: How to Use Lettable Operators and Promises
Lettable operators are higher-order functions that return functions that receive and return observables. The toPromise higher-order function ...
Read more >Nothing has changed.. The only promise-related change that… | by ...
The only promise-related change that was effected with the introduction of lettable/pipeable operators was the moving of toPromise from an operator to an ......
Read more >toPromise - Learn RxJS
Convert observable to promise. ... ⚠ toPromise is not a pipable operator, as it does not return an observable.
Read more >Error while importing RxJS operators in Angular - Stack Overflow
The catch and do operators were replaced with catchError and tap respectively. Nothing has to be imported for toPromise since it isn't pipeable ......
Read more >Pipeable Operators - RxJS
The former toPromise() "operator" has been removed because an operator ... It used to be the origin of the name ("lettable"), but that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
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
@mebibou Don’t pipe. It’s on the Observable object by default.
So what is the proper way of using
toPromise
onObservable
now?