Wait for a browser to be online
Good for the chain of promises or async
/await
.
npm install --save wait-for-online
import waitForOnline from 'wait-for-online'
async function send (data) {
await waitForOnline()
await sendToApi(data)
}
send({foo: 1})
Returns a promise that resolves, when browser will be online.
Type: number
Default: Infinity
Waiting timeout.
MIT