import type { PersonalTimeStatus } from "./mod.ts"; const storageName = "takker-scheduler-dashboard"; export const read = (): PersonalTimeStatus => JSON.parse(localStorage.getItem(storageName) ?? ""); export const write = (status: PersonalTimeStatus): void => { localStorage.setItem(storageName, JSON.stringify(status)); }; export const listen = (callback: CallableFunction): void => { globalThis.addEventListener("storage", (e: StorageEvent) => { if (e.key !== storageName) return; callback(); }); };