Skip to content

Instantly share code, notes, and snippets.

@binura-g
Created January 29, 2018 16:17
Show Gist options
  • Save binura-g/5c9959ad6b3da71f9d3fcaf4d698b937 to your computer and use it in GitHub Desktop.
Save binura-g/5c9959ad6b3da71f9d3fcaf4d698b937 to your computer and use it in GitHub Desktop.
Promises example 2
const myPromise = new Promise((resolve, reject) => {
// do something asynchronous which eventually calls either:
//
// resolve(someValue); // when fulfilled
// or
// reject("failure reason"); // upon failure or rejection
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment