Skip to content

Instantly share code, notes, and snippets.

@ahomu
Created January 13, 2014 05:20
Show Gist options
  • Save ahomu/8395141 to your computer and use it in GitHub Desktop.
Save ahomu/8395141 to your computer and use it in GitHub Desktop.
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