Skip to content

Releases: kleinfreund/poll

v3.2.1

18 Oct 15:12
3f655a8
Compare
Choose a tag to compare

3.2.1 (2022-10-18)

Bug fixes

  • Fixes the type for poll incorrectly marking the shouldStopPolling argument as required.

v3.2.0

27 Nov 18:28
Compare
Choose a tag to compare

3.2.0 (2021-11-27)

Features

  • 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).

v3.1.0

13 Nov 14:09
Compare
Choose a tag to compare

3.1.0 (2021-11-13)

Features

  • Adds support for asynchronous shouldStopPolling functions.

v3.0.0

16 Aug 17:12
Compare
Choose a tag to compare

3.0.0 (2021-08-16)

Breaking changes

  • 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 replacing import poll from 'poll' with import { poll } from 'poll'.

v2.0.0

21 Mar 21:04
Compare
Choose a tag to compare

2.0.0 (2021-03-21)

docs

  • Updates the README.md file with regards to this release’s breaking changes and fixes a few issues in the usage examples.

BREAKING CHANGES

  • 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.

v1.0.0

04 Aug 07:26
Compare
Choose a tag to compare

poll

I’ve ported the poll function to TypeScript to give me a comfortable way of creating both a CommonJS and an ES module out of a single source. This comes with the downside of not being able to produce a CommonJS module which uses module.exports = poll. I can only get the TypeScript compiler to produce exports.default = poll or exports.poll = poll. What this means is that you can’t have a CommonJS module compiled from a TypeScript source which you can import with require('poll').

Breaking changes:

  • Importing the CommonJS module with require('poll') no longer resolves to the poll function. Use require('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 animport poll from 'poll/dist/esm/poll.mjs'; 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 sprinkling await Promise.resolve() all over my tests, I’m all ears!