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

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i cf-util-http-poll

Weekly Downloads

45

Version

2.7.16

License

BSD-3-Clause

Unpacked Size

6.57 kB

Total Files

7

Last publish

Collaborators

  • lbarthonet
  • cf-media-manager
  • jacobbednarz
  • celso
  • cf-radar
  • dash_service_account
  • g4brym
  • snigdha34
  • wrangler-publisher
  • marksteyn
  • chiminator
  • sgoodhew_cf
  • terinjokes
  • third774
  • jsteinberger
  • jasnell
  • asapzacy
  • pcostanzo
  • gregbrimble
  • geelen
  • rexscaria
  • dcruz_cf
  • xuranwang
  • jculvey
  • sejoker
  • vasturiano
  • cf-ci-write
  • segments-write
  • thibmeu
  • xortive
  • gurjinder
  • cf-ci2
  • lvalenta
  • worenga