Skip to content

Instantly share code, notes, and snippets.

@scwood
Last active July 2, 2018 23:33
Show Gist options
  • Select an option

  • Save scwood/334682923cb9ddb36abdb2036f67f023 to your computer and use it in GitHub Desktop.

Select an option

Save scwood/334682923cb9ddb36abdb2036f67f023 to your computer and use it in GitHub Desktop.
function promisify(fn) {
return (...args) => {
return new Promise((resolve, reject) => {
fn(...args, (error, ...result) => {
error ? reject(error) : resolve(...result);
})
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment