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 https://github.com/facebook/react-native/pull/16115 Differential Revision: D6017950 Pulled By: shergin fbshipit-source-id: 296f3467152eb6eedac817a89cf075e9f906a389
This commit is contained in:
parent
b9da155fd8
commit
4eccb16935
|
@ -33,6 +33,12 @@ declare class Promise<+R> {
|
||||||
static race<T>(promises: Array<Promise<T>>): Promise<T>;
|
static race<T>(promises: Array<Promise<T>>): Promise<T>;
|
||||||
|
|
||||||
// Non-standard APIs
|
// 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>(
|
done<U>(
|
||||||
onFulfill?: ?(value: R) => mixed,
|
onFulfill?: ?(value: R) => mixed,
|
||||||
onReject?: ?(error: any) => mixed
|
onReject?: ?(error: any) => mixed
|
||||||
|
|
Loading…
Reference in New Issue