Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Last active March 2, 2020 05:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/7799aabfb41f6cd8416c9b450c8dd83c to your computer and use it in GitHub Desktop.
Save YonatanKra/7799aabfb41f6cd8416c9b450c8dd83c to your computer and use it in GitHub Desktop.
Bad retry
function retry() {
try {
console.log(window.toBe.orNotToBe);
} catch(e) {
retry();
}
}
retry();
// simulate a fetch action from the server
setTimeout(() => {
window.toBe = {orNotToBe: "That is the question!"}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment