Axios-polling is a library that extends Axios with polling capabilities, allowing you to create and manage polling requests with configurable retry limits, delays, and event handlers. Version 1.1.1 is stable, with an active release cadence. It requires Axios >=0.3 or >=1 and ships TypeScript types. Key differentiators include built-in retry logic, delay gaps, and event-based monitoring of request lifecycle.
npm install axios-pollingNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes axios-polling, creates a polling request, starts it, listens for responses, and stops after 10 seconds.
Update to version 1.1.0 or later, or change import to 'import { axiosPolling } from 'axios-polling''.Always call axiosPolling(axios, config) before any axios.poll() calls.
Use 'emit()' to send each poll cycle. To stop polling, call 'off()' or 'remove()'.
Replace 'retryCount' with 'retryLimit' in the config object.
Call axiosPolling(axios, config) before using axios.poll().
Ensure the same axios instance is used for both initialization and polling calls.
Run npm install axios-polling, and use import instead of require if the environment supports ESM.