Created
February 24, 2024 13:49
-
-
Save tiagorangel1/7281f3980503beea660c45bc01d5cae9 to your computer and use it in GitHub Desktop.
Simple hot reload for HTML
This file contains hidden or 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
setTimeout(async function () { | |
let o = await (await fetch(location.href)).text(); | |
var i = setInterval(async function () { | |
var n = await (await fetch(location.href)).text(); | |
if (!(o == n)) { location.reload(); clearInterval(i) } | |
}, 500) | |
}, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment