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