3.2.2 (2023-05-18)
- Fixes
pkg.exports
missing types for bare module specifiers (i.e. imports frompoll
). - Adds missing entry for the type definition file (can now be imported
poll/types/index.d.ts
without TypeScript complaining).
3.2.1 (2022-10-18)
- Fixes the type for
poll
incorrectly marking theshouldStopPolling
argument as required.
3.2.0 (2021-11-27)
- Adds support for providing a delay function which returns the delay value allowing customization of the polling interval. This can be utilized to implement polling with exponential backoff (i.e. where the polling interval steadily increases over time).
3.1.0 (2021-11-13)
- Adds support for asynchronous
shouldStopPolling
functions.
3.0.0 (2021-08-16)
- Changes the package’s distribution format from UMD to ES module.
- Changes the exported
poll
function from a default export to a named export. Update your code by replacingimport poll from 'poll'
withimport { poll } from 'poll'
.
2.0.1 (2021-03-27)
- Fixes incorrect usage instructions in README.md file.
2.0.0 (2021-03-21)
- Removes the separate ESM and CJS bundles in favour of one UMD bundle that can be used more easily in most scenarios while keeping the bundle size down. The bundle in the dist directory is now also minified.
1.0.1 (2019-08-23)
- Removes safe guard preventing use of
poll
function with negativedelay
values.
1.0.0 (2019-08-04)
-
Importing the CommonJS module with
require('poll')
no longer resolves to thepoll
function. Userequire('poll').default
instead.const poll = require('poll').default;
Non-breaking changes:
-
The package is now available as an ES module. If you use
poll
as a dependency, import it like this:import poll from 'poll/dist/esm/poll.mjs';
-
Tests now use Jest instead of Ava.
-
Tests are now based on fake timers instead of calling
setTimeout
in the tests directly. Unfortunately, tests still require a lot of trickery to manually clear out the promise queue. If you know how to test this without sprinklingawait Promise.resolve()
all over my tests, I’m all ears!
- Releases initial version of the poll package.