Skip to content

Instantly share code, notes, and snippets.

@jordangarcia
Created April 24, 2020 20:27
Show Gist options
  • Save jordangarcia/2ba18a5009f6e5b8bf02390f0e2e7f71 to your computer and use it in GitHub Desktop.
Save jordangarcia/2ba18a5009f6e5b8bf02390f0e2e7f71 to your computer and use it in GitHub Desktop.
const promise = new Promise2((resolve, reject) => {
setTimeout(() => {
resolve('hello')
}, 500)
})
promise.then((value) => {
console.log(value)
})
// we want .then(resolveHandler, rejectHandler)
// chaining is not necessary for now
// static methods arent necessary Promise.resolve / Promise.reject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment