-
-
Save chrisdel101/57d7db61bcf9e7f9150c54a6efd6f119 to your computer and use it in GitHub Desktop.
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
| // get array of ids | |
| function getTopIDs(url) { | |
| return fetch(url).then(blob => blob.json()).then(json => json) | |
| } | |
| // returns a promise resolves to an object | |
| function getStory(id) { | |
| let url = `https://hacker-news.firebaseio.com/v0/item/${id}.json?print=pretty` | |
| return fetch(url).then(blob => blob.json()).then(json => json) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment