Last active
June 5, 2020 20:35
-
-
Save chrisgfortes/ee4409fe8d80981d70a137306daae8d3 to your computer and use it in GitHub Desktop.
Promisify - Function promisification
This file contains 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
// Reference: https://stackoverflow.com/a/49250525 | |
const promisify = func => (...args) => new Promise((resolve, reject)=> func(...args, (err, res) => err ? reject(err) : resolve(res))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment