Skip to content

Instantly share code, notes, and snippets.

@armenr
Last active March 28, 2017 01:30
Show Gist options
  • Save armenr/d083376d51ab6fe4bfa3153408095d4b to your computer and use it in GitHub Desktop.
Save armenr/d083376d51ab6fe4bfa3153408095d4b to your computer and use it in GitHub Desktop.
Simple promise
require('es6-promise');
// setTimeout(function() { console.log('TIMED OUT!') }, 300);
var promise = new Promise((fulfill, reject) => {
setTimeout(() => {
fulfill("FULFILLED!")
}, 300)
})
.then((successMessage) => {
console.log(successMessage)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment