Function: onOffline()
ts
function onOffline(callback): () => void;Registers a callback for when the browser goes offline and returns an unsubscribe function.
Parameters
| Parameter | Type |
|---|---|
callback | () => void |
Returns
() => void
Example
ts
const off = onOffline(() => console.log('went offline'))
off()Since
1.0.0