refactor: share dom ready

This commit is contained in:
2026-06-01 22:25:47 +02:00
committed by Milas Holsting
parent 4a1467467c
commit e269d15199
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;