Created
April 19, 2016 19:10
-
-
Save skarfacegc/a95069cd22b633cdbff1af2345d72250 to your computer and use it in GitHub Desktop.
promise example from erik
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
function promised(fn) { | |
return function(cb) { | |
return new Promise(function(resolve, reject) { | |
fn(function { cb(); resolve() }); | |
}); | |
} | |
} | |
promised(myAsync)(myCallback).then(...); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment