Skip to content
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 finally method to Promise flow definition #16115

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions flow/Promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ declare class Promise<+R> {
static race<T>(promises: Array<Promise<T>>): Promise<T>;

// Non-standard APIs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May want to make a new section for TC-39 proposals, finally() is in Stage 3


// 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
Expand Down