-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
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
Add support for Promise's .finally()
method.
#5810
Comments
Does Flow support proposal APIs? You could derive a new class from Promise until it lands in core.js: declare class PromiseWithFinally<+R> extends Promise<R> {
finally<U>(onFinally: () => U): Promise<U>;
} |
It seems like |
Not only is it stage 4, it already is available in the standard releases of both Firefox and Chrome, and Microsoft's ChakraCore has it in the code already (just merged into master 3 days ago). |
Ran into this as well, |
This is now supported in Flow: https://github.com/facebook/flow/blob/master/lib/core.js#L636 |
Using the promise method
.finally()
will break flow's typing. Here's a silly example:Is there a clean way to use the promise method
.finally()
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/finally) and not break Flow's typing?In
core.js
I see it's not supported on thePromise
object: https://github.com/facebook/flow/blob/master/lib/core.js#L591-L610. Is there a particular reason why?The text was updated successfully, but these errors were encountered: