import { createSignal, Show } from "solid-js"; /** * Creates a trigger/signal pair for showing a brief "remote update" flash. * Call `fire()` when a remote WebSocket update arrives; `visible()` goes * true for `durationMs` then auto-clears. */ export function createRemoteFlash(durationMs = 3000) { const [visible, setVisible] = createSignal(false); let timer: ReturnType | null = null; const fire = () => { setVisible(true); if (timer) clearTimeout(timer); timer = setTimeout(() => { setVisible(false); timer = null; }, durationMs); }; return { visible, fire }; } interface RemoteUpdateFlashProps { when: boolean; } /** * A small pill that briefly shows "Updated". */ export function RemoteUpdateFlash(props: RemoteUpdateFlashProps) { return
Updated
; }