Permalink
Browse files

Add finally method to Promise flow definition

Summary:
The `finally` method definition was missing, while it really exists causing a flow error when using it.

Added the method definition and make sure flow doesn't throw any error anymore on a real-life example.
Closes #16115

Differential Revision: D6017950

Pulled By: shergin

fbshipit-source-id: 296f3467152eb6eedac817a89cf075e9f906a389
  • Loading branch information...
Bhullnatik authored and facebook-github-bot committed Oct 10, 2017
1 parent b9da155 commit 4eccb1693580bba37368e7cfae8de41f08e3af36
Showing with 6 additions and 0 deletions.
  1. +6 −0 flow/Promise.js
View
@@ -33,6 +33,12 @@ declare class Promise<+R> {
static race<T>(promises: Array<Promise<T>>): Promise<T>;
// Non-standard APIs
// See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21
finally<U>(
onFinally?: ?(value: any) => Promise<U> | U
): Promise<U>;
done<U>(
onFulfill?: ?(value: R) => mixed,
onReject?: ?(error: any) => mixed

0 comments on commit 4eccb16

Please sign in to comment.