Skip to content

Instantly share code, notes, and snippets.

@jeffmo
Last active August 20, 2016 04:03
Show Gist options
  • Save jeffmo/52e0083d6536bb44d5db3ee73b57580b to your computer and use it in GitHub Desktop.
Save jeffmo/52e0083d6536bb44d5db3ee73b57580b to your computer and use it in GitHub Desktop.

We removed Promise.prototype.done a while back because it's not actually in the JS spec. The hacky workaround for getting it back would be to copy the promise definition here into your own libdef file.

Specifically: Copy it (only the declare class Promise { ... } definition) into some file called, say, promise-override.js and put that file into a directory called flow-typed in the same directory as your .flowconfig file. From there you can update your override to include a definition for done().

(The flow-typed directory is a special directory that Flow assumes contains library definitions if it exists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment