Created
February 23, 2017 15:04
-
-
Save tstirrat15/a0874a24e16b4b56963ef3acdd3416c6 to your computer and use it in GitHub Desktop.
Fetch Pattern
This file contains 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
let data = {}; | |
try { | |
data = await response.json(); | |
} catch (error) { | |
// There wasn't any data to unpack. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment