Miss any of our Open RFC calls?Watch the recordings here! »

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();

Keywords

none

Install

npm i cf-util-http-poll

DownloadsWeekly Downloads

10

Version

2.7.16

License

BSD-3-Clause

Unpacked Size

6.57 kB

Total Files

7

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar