In the submitted article, two callback methods are usually provided (one for success and another for failure). Is that possible when using generators? If so, what does that look like?
try {
var user = yield Users.get(1234);
return user.name;
} catch(ex) {
// do whatever
}
rather than.. return Users.get(1234).then(
function (u) { return u.name; },
function (ex) { /* do whatever */ }
); Users.get(1234)
.then(u => u.name)
.catch(ex => 1/* do whatever */);