Created
March 16, 2017 17:46
-
-
Save Gaafar/7661b4a6c5999505ee54cdefe9ad1c7a to your computer and use it in GitHub Desktop.
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
const makeRequest = () => { | |
try { | |
getJSON() | |
.then(result => { | |
// this parse may fail | |
const data = JSON.parse(result) | |
console.log(data) | |
}) | |
// uncomment this block to handle asynchronous errors | |
// .catch((err) => { | |
// console.log(err) | |
// }) | |
} catch (err) { | |
console.log(err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment