Skip to content

Instantly share code, notes, and snippets.

@jooyunghan
Created December 6, 2015 23:37
Show Gist options
  • Save jooyunghan/c50a706b070790bf5581 to your computer and use it in GitHub Desktop.
Save jooyunghan/c50a706b070790bf5581 to your computer and use it in GitHub Desktop.
Async Exercises
/*
Using following two API functions
- deletePage(pageId, callback) : delete a page. if the page has sub-pages then it fails.
- getChildPages(pageId, callback) : get a list of ids of direct child pages.
write deleteTree(pageId, callback) function which
deletes the pages of pageId and sub-pages.
*/
function deleteTree(pageId, callback) {
}
/*
Using following two API functions
- deletePage(pageId) : returns a Promise. delete a page. if the page has sub-pages then it fails.
- getChildPages(pageId) : returns a Promise. get a list of ids of direct child pages.
write deleteTree(pageId) function which
deletes the pages of pageId and sub-pages
and returns a promise.
*/
function deleteTree(pageId) {
}
/*
Using following two API functions
- deletePage(pageId) : returns a Promise. delete a page. if the page has sub-pages then it fails.
- getChildPages(pageId) : returns a Promise. get a list of ids of direct child pages.
write an async deleteTree(pageId) function which
deletes the pages of pageId and sub-pages
*/
async function deleteTree(pageId) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment