Skip to content

Instantly share code, notes, and snippets.

@mohnatus
Created February 11, 2019 10:07
Show Gist options
  • Select an option

  • Save mohnatus/3e43bce8a552cf29f63cea5d39099301 to your computer and use it in GitHub Desktop.

Select an option

Save mohnatus/3e43bce8a552cf29f63cea5d39099301 to your computer and use it in GitHub Desktop.
general promise constructor
let promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve('new value');
}, 1000)
});
promise
.then(
data => console.log(data),
error => console.log(error)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment