Have ideas to improve npm?Join in the discussion! »

    polling-js
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.5 • Public • Published

    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

    Keywords

    Install

    npm i polling-js

    DownloadsWeekly Downloads

    124

    Version

    0.0.5

    License

    MIT

    Unpacked Size

    25 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar