We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The overload signatures for the new operators/toPromise function include:
operators/toPromise
export function toPromise<T>(PromiseCtor: typeof Promise): UnaryFunction<Observable<T>, Promise<T>>;
If the intention is to allow for the use of an arbitrary promise implementation, this seems overly specific.
PromiseConstructorLike and PromiseLike could be used instead:
PromiseConstructorLike
PromiseLike
export function toPromise<T>(PromiseCtor: PromiseConstructorLike): UnaryFunction<Observable<T>, PromiseLike<T>>;
RxJS version: 5.5.0-beta.3
Code to reproduce:
import { Promise as Bluebird } from "bluebird"; import { toPromise } from "rxjs/operators"; const func = toPromise(Bluebird);
Expected behavior:
No error.
Actual behavior:
An error is effected, as Bluebird does not include the Symbol.species property.
Symbol.species
Additional information:
Since at least version 2.0.10, TypeScript's in-built typings have included PromiseLike and PromiseConstructorLike.
The text was updated successfully, but these errors were encountered:
chore(typings): improve toPromise typings
1624bca
Add an overload signature that uses PromiseConstructorLike and PromiseLike. Closes ReactiveX#2904
11f5611
124e231
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.
Sorry, something went wrong.
No branches or pull requests
The overload signatures for the new
operators/toPromise
function include:If the intention is to allow for the use of an arbitrary promise implementation, this seems overly specific.
PromiseConstructorLike
andPromiseLike
could be used instead:RxJS version: 5.5.0-beta.3
Code to reproduce:
Expected behavior:
No error.
Actual behavior:
An error is effected, as Bluebird does not include the
Symbol.species
property.Additional information:
Since at least version 2.0.10, TypeScript's in-built typings have included
PromiseLike
andPromiseConstructorLike
.The text was updated successfully, but these errors were encountered: