Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created March 2, 2020 14:27
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/936053e21fd63f0d6d95c5cb46cb3aff to your computer and use it in GitHub Desktop.
Save YonatanKra/936053e21fd63f0d6d95c5cb46cb3aff to your computer and use it in GitHub Desktop.
function retry() {
try {
console.log(window.toBe.orNotToBe);
} catch(e) {
setTimeout(retry, 250);
}
}
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