Created
January 13, 2014 05:20
-
-
Save ahomu/8395141 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
var thunk = require('thunkify'); | |
var delay = thunk(function(cb) { | |
setTimeout(function() { | |
console.log('delay end'); | |
cb(); | |
}, 1000); | |
}); | |
var n = delay() | |
setTimeout(function() { | |
console.log('set callback'); | |
n(function() { | |
console.log('call!'); | |
}); | |
}, 2000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment