useOnline
Reactive navigator.onLine via the online/offline events. Browser composable — import from @sigx/use-web.
import { effect } from 'sigx';
import { useOnline } from '@sigx/use-web';
const online = useOnline();
effect(() => { if (!online.value) showOfflineBanner(); });
This is the sugar form of the cross-platform connectivity contract — useOnline() is useNetwork().isConnected as a standalone ReadSignal<boolean>. Reach for useNetwork when you also need type or the Network Information API extras.
Signature
function useOnline(options?: ConfigurableWindow): ReadSignal<boolean>;
Pass { window } to drive it from a mock — see Configurable*.
SSR
On the server the signal reads true, then reflects navigator.onLine on mount.
See also
useNetwork— the full state (type,effectiveType,downlink,saveData).useDocumentVisibility— the other "is now a good time to do work" sensor.- Conventions → Cross-platform contracts — connectivity as a shared contract.
