Skip to content

Instantly share code, notes, and snippets.

@bttmly
Created September 10, 2015 13:31
Show Gist options
  • Save bttmly/491755d9dba61a947309 to your computer and use it in GitHub Desktop.
Save bttmly/491755d9dba61a947309 to your computer and use it in GitHub Desktop.
let promisify = fn => (...args) =>
new Promise((resolve, reject) => {
fn(...args, (err, result) => {
if (err) return reject(err);
resolve(result);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment