Skip to content

Instantly share code, notes, and snippets.

@cuipengfei
Created December 16, 2013 05:57
Show Gist options
  • Select an option

  • Save cuipengfei/7982900 to your computer and use it in GitHub Desktop.

Select an option

Save cuipengfei/7982900 to your computer and use it in GitHub Desktop.
promise it wont hurt reject a promise
var q = require('q');
var defer = q.defer();
defer.promise.then(null, function(err) {
console.log(err)
})
setTimeout(function() {
defer.reject("REJECTED!")
}, 300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment