Last active
July 2, 2018 23:33
-
-
Save scwood/334682923cb9ddb36abdb2036f67f023 to your computer and use it in GitHub Desktop.
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
| 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