Created
July 26, 2019 18:09
-
-
Save carlrip/9877246cb670552988d3b120634ecad6 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
| type LogDataOptions = { | |
| skip?: boolean; | |
| path?: string; | |
| }; | |
| async function logData({ | |
| skip = false, | |
| path = "https://swapi.co/api/people/1" | |
| }: LogDataOptions) { | |
| if (!skip) { | |
| const response = await fetch(path); | |
| const data = await response.json(); | |
| console.log(data); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment