This package has been deprecated
Author message:
This package has been deprecated. Please find this package under its new name @cloudflare/util-http-poll.
cf-util-http-poll
2.7.16 • Public • Published cf-util-http-poll
Cloudflare HTTP Polling Util
Installation
$ npm install cf-util-http-poll
Usage
import poll from 'cf-util-http-poll';
const cancelPolling = poll('/api/v4/dnssec/status', {
interval: 2000,
timeout: 60000,
isComplete(res) {
return !!res.body.active;
},
onComplete(res) {
console.log('`isComplete` returned `true` for a response.');
},
onError(res) {
console.log('An error was returned from the server.');
},
onCancel() {
console.log('Polling was cancelled before `onComplete` was called.');
}
});
cancelPolling();
Versions
Current Tags
- VersionDownloads (Last 7 Days)
Version History
- VersionDownloads (Last 7 Days)
Package Sidebar
Install
Weekly Downloads