useConnectionStatus
One honest signal for whether the server is reachable — derived, never polled.
Connection health from the two signals the client genuinely has, so apps stop hand-rolling a degraded-connection state machine in an auth provider.
import { useConnectionStatus } from '@voltro/client'
const { status, reportSuccess } = useConnectionStatus('app')
{status !== 'connected' && <OfflineBanner status={status} />}status is 'connected' | 'degraded' | 'offline'. offline is browser-reported
(navigator.onLine plus its online / offline events) — reliable for "the
network is gone", and it wins over degraded. degraded means an rpc on that
api failed and nothing has succeeded since; it is real evidence, not a guess.
Coming back online clears the failure count, since failures counted during an
offline window are that window. reportSuccess() clears it eagerly from a
place that knows a call went through.
Also returned: online, failureCount, lastFailureAt. There is deliberately
no polling ping — the framework does not call the server just to colour an
indicator, so connected means "nothing has failed", not "just verified".