Skip to content

Instantly share code, notes, and snippets.

@esk525
Created January 18, 2012 20:31
Show Gist options
  • Save esk525/1635365 to your computer and use it in GitHub Desktop.
Save esk525/1635365 to your computer and use it in GitHub Desktop.
Futures with error catching vs throwing...
var Future = require('futures');
var f = Future.future();
var opts = { error: console.error };
var f1 = Future.future(null,opts);
f.when( console.log.bind(console,"f fulfilled"));
f1.when( console.log.bind(console,"f1 fulfilled"));
f1.fulfill();
f1.deliver();
console.log('after f1 fulfilled');
f.fulfill();
f.deliver();
console.log('after f fulfilled');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment