UNPKG

web-api-hooks

Version:

Essential set of React Hooks for convenient Web API consumption.

15 lines (14 loc) 455 B
/** * Tracks information about the network's availability. * * ⚠️ _This attribute is inherently unreliable. A computer can be connected to a network without having internet access._ * * @returns `false` if the user agent is definitely offline, or `true` if it might be online. * * @example * function Component() { * const isOnline = useNetworkAvailability(); * // ... * } */ export default function useNetworkAvailability(): boolean;