Created
February 27, 2024 09:30
-
-
Save dejurin/34754e0e09927a11c83d30499cce5b54 to your computer and use it in GitHub Desktop.
useOnDocument
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
useOnDocument( | |
"readystatechange", | |
$(() => { | |
const id = setInterval(() => { | |
isMounted.value = true; | |
const dt = getTimeLuxon({ timeZone, locale: "en-US" }); | |
stateTime.value = noSerialize(dt) as DateTime & { | |
__no_serialize__: true; | |
}; | |
}, 1000); | |
return () => { | |
clearInterval(id); | |
}; | |
}), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment