Skip to content

Instantly share code, notes, and snippets.

@bttmly
Created September 17, 2015 00:58
Show Gist options
  • Save bttmly/13e0d873ad736a01e437 to your computer and use it in GitHub Desktop.
Save bttmly/13e0d873ad736a01e437 to your computer and use it in GitHub Desktop.
promisify is a one-liner in idiomatic es6
let promisify = func => (...args) => new Promise((resolve, reject) => func(...args, (err, result) => err ? reject(err) : resolve(result)));
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment