Skip to content

Instantly share code, notes, and snippets.

@tomquas
Forked from lilactown/promises.re
Created February 9, 2018 08:01
Show Gist options
  • Select an option

  • Save tomquas/c0558728e7a89d414df500952aacaabc to your computer and use it in GitHub Desktop.

Select an option

Save tomquas/c0558728e7a89d414df500952aacaabc to your computer and use it in GitHub Desktop.
Notes on using JavaScript Promises in ReasonML/BuckleScript
/* Making promises */
let promise = Js.Promise.make (fun ::resolve ::reject => resolve "OK!" [@bs]);
/* Operating on promises */
Js.Promise.then_ (fun result => Js.log result);
/*Js.Promise.catch*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment