refactor: share dom ready

This commit is contained in:
2026-06-01 22:25:47 +02:00
parent 36435b6eb5
commit 455490f07d
4 changed files with 13 additions and 26 deletions

View File

@@ -1,13 +1,6 @@
export {};
const onReady = (fn: () => void): void => {
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", fn, { once: true });
return;
}
fn();
};
import { onReady } from "./utils";
const isMobileViewport = (): boolean => window.matchMedia("(max-width: 1023px)").matches;