0.0.5 • Published 4 years ago

polling-js v0.0.5

Weekly downloads
61
License
MIT
Repository
github
Last release
4 years ago

Polling.js

Installation

npm install polling-js

Usage

import { setPolling } from 'polling-js';

const fetchUserData = (signal) => {
  return fetch('https://api.randomuser.me/', {signal})
    .then(response => response.json())
    .then(user => console.log(user));
};

const cancelPolling = setPolling(fetchUserData, 1000, new AbortController());

setTimeout(cancelPolling, 10000);

License

MIT

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago