Skip to content

Instantly share code, notes, and snippets.

@chrisgfortes
Last active June 5, 2020 20:35
Show Gist options
  • Save chrisgfortes/ee4409fe8d80981d70a137306daae8d3 to your computer and use it in GitHub Desktop.
Save chrisgfortes/ee4409fe8d80981d70a137306daae8d3 to your computer and use it in GitHub Desktop.
Promisify - Function promisification
// 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