spences10
2/1/2017 - 9:38 AM

Promise example from Kyle Robinson Young, https://github.com/shama/letswritecode/blob/master/async-js-with-promises/index.js

// Creating promises
var promise = new Promise(function (resolve, reject) {
  resolve('all good')
})

promise.then(function (result) {
  console.log('was it good?', result)
}).catch(function (err) {
  console.error('ERR', err)
})