Last active
August 18, 2019 07:47
-
-
Save Tomotoes/1cb07df07fdfbe5d9da696ff69c801ca to your computer and use it in GitHub Desktop.
Gengrate asynchronous function.
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
const promisify = callback => (...args) => | |
new Promise((resolve, reject) => | |
callback(...args, (err, data) => err ? reject(err) : resolve(data)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment