Skip to content

Instantly share code, notes, and snippets.

@dejurin
Created February 27, 2024 09:30
Show Gist options
  • Save dejurin/34754e0e09927a11c83d30499cce5b54 to your computer and use it in GitHub Desktop.
Save dejurin/34754e0e09927a11c83d30499cce5b54 to your computer and use it in GitHub Desktop.
useOnDocument
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