Skip to content

Instantly share code, notes, and snippets.

@pantaluna
Created June 2, 2016 18:12
Show Gist options
  • Save pantaluna/6a3cb8e0a96575bf3302931528e022a4 to your computer and use it in GitHub Desktop.
Save pantaluna/6a3cb8e0a96575bf3302931528e022a4 to your computer and use it in GitHub Desktop.
let getGraphChecklistById = Promise.coroutine(function*(pId) {
console.log('> getGraphChecklistById()');
let checklist = yield getChecklistById(pId);
checklist.__node__ChecklistItemGroups = yield fetchChecklistItemGroupsByChecklistId(pId); // Returns a promise.
for (let pItem of checklist.__node__ChecklistItemGroups) {
pItem.__node__ChecklistItems = yield fetchChecklistItemsByXrefId(pItem.xchlclig_id);
}
return checklist;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment