Created
December 6, 2015 23:37
-
-
Save jooyunghan/c50a706b070790bf5581 to your computer and use it in GitHub Desktop.
Async Exercises
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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