Created
September 17, 2015 00:58
-
-
Save bttmly/13e0d873ad736a01e437 to your computer and use it in GitHub Desktop.
promisify is a one-liner in idiomatic es6
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
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