Skip to content

Function: onOffline()

ts
function onOffline(callback): () => void;

Registers a callback for when the browser goes offline and returns an unsubscribe function.

Parameters

ParameterType
callback() => void

Returns

() => void

Example

ts
const off = onOffline(() => console.log('went offline'))
off()

Since

1.0.0

Released under the MIT License.