Skip to content

Instantly share code, notes, and snippets.

@id0Sch
Created August 25, 2015 07:25
Show Gist options
  • Save id0Sch/0ea31d5fc50c023dd169 to your computer and use it in GitHub Desktop.
Save id0Sch/0ea31d5fc50c023dd169 to your computer and use it in GitHub Desktop.
/**
* 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