Last active
May 15, 2018 14:18
-
-
Save shlomisas/374fded0110ff2ecbadecaa40cd2348b to your computer and use it in GitHub Desktop.
js-browser-app-event-listener-error-handling
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
$('#someButton').click(async evt => { | |
try { | |
const userId = $(evt.target).attr('data-user-id'); | |
const res = await axios.get(`/user/${userId}`); | |
// Assume that `render` function exists | |
render(res); | |
} catch (e) { | |
console.log(e); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment