Skip to content

Function: onOnline()

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

Registers a callback for when the browser comes back online and returns an unsubscribe function.

Parameters

ParameterType
callback() => void

Returns

() => void

Example

ts
const off = onOnline(() => console.log('back online'))
off()

Since

1.0.0

Released under the MIT License.