Skip to content

Instantly share code, notes, and snippets.

@ifandelse
Created August 25, 2014 18:07
Show Gist options
  • Save ifandelse/ba69d565de78700e43a2 to your computer and use it in GitHub Desktop.
Save ifandelse/ba69d565de78700e43a2 to your computer and use it in GitHub Desktop.
Adapting ES6 presentation example from Q to when.js
var gen = require('when/generator');
gen.call(function* () {
try {
var [pratt, ferrell] = yield when.all([
read("emmet.json"),
read("lordbusiness.json")
]);
render(pratt);
render(ferrell);
} catch (e) {
console.log("Not Awesome: " + e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment