Created
June 27, 2017 10:39
-
-
Save Kamisama666/f46fd65953bf4899af72756ee5478602 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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