From 20cb8e955e94bc2f806f898470fd49ecc1883c33 Mon Sep 17 00:00:00 2001 From: Jimmy Mayoukou Date: Wed, 27 Sep 2017 18:31:13 +0200 Subject: [PATCH] Add finally method to Promise flow definition The `finally` method definition was missing, while it really exists causing a flow error when using it. --- flow/Promise.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flow/Promise.js b/flow/Promise.js index a85abea26e30a2..4f6fb3971eebcb 100644 --- a/flow/Promise.js +++ b/flow/Promise.js @@ -33,6 +33,12 @@ declare class Promise<+R> { static race(promises: Array>): Promise; // Non-standard APIs + + // See https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/__forks__/Promise.native.js#L21 + finally( + onFinally?: ?(value: any) => Promise | U + ): Promise; + done( onFulfill?: ?(value: R) => mixed, onReject?: ?(error: any) => mixed