Skip to content

Instantly share code, notes, and snippets.

@Kamisama666
Created June 27, 2017 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kamisama666/f46fd65953bf4899af72756ee5478602 to your computer and use it in GitHub Desktop.
Save Kamisama666/f46fd65953bf4899af72756ee5478602 to your computer and use it in GitHub Desktop.
const Q = require('q');
/**
* Transforms a Q Promise to a Promise
* @param {QPromise} qpromise
* @return {Promise}
*/
function qp(qpromise) {
return new Promise(function(resolve, reject) {
qpromise
.then(function(result) {
resolve(result);
})
.fail(function(error) {
reject(error);
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment