Last active
September 15, 2015 15:51
-
-
Save RReverser/79afe3bfacbe054264d6 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 awaitableVersionOf(nodeFunction) { | |
return (...args) => new Promise((resolve, reject) => { | |
nodeFunction( | |
...args, | |
(error, ...cbArgs) => error ? reject(error) : resolve(...cbArgs) | |
); | |
}); | |
} |
I don't think so. Are you aware of any node.js lib that cares about result of callback?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does it matter much to the
nodeFunction
that you're using=>
for all the closures instead offunction()
?