Created
August 25, 2015 07:25
-
-
Save id0Sch/0ea31d5fc50c023dd169 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Created by idoschachter on 4/20/15. | |
*/ | |
'use strict'; | |
var Promise = require('bluebird'); | |
// Helper methods | |
function promisify(err, data) { | |
return function() { | |
return new Promise(function(resolve, reject) { | |
err ? reject(err) : resolve(data); | |
}) | |
} | |
} | |
/** | |
* @expose | |
*/ | |
module.exports = { | |
promisify: promisify, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment