Skip to content

Releases: sindresorhus/delay

v6.0.0

21 May 16:03
Compare
Choose a tag to compare

Breaking

  • Require Node.js 16 b2edac7
  • This package is now pure ESM. Please read this.
  • Removed the delay.reject() method.
    • It's not really needed anymore with async/await. Just throw an error after awaiting the delay.
  • const delay = require('delay'); delay.clear(…);import {clearDelay} from 'delay'; clearDelay(…);
  • const delay = require('delay'); delay.range(…);import {rangeDelay} from 'delay'; rangeDelay(…);
  • const delay = require('delay'); delay.createWithTimers(…);import {createDelay} from 'delay'; createDelay(…);

If you only target Node.js and not the browser, I recommend moving to the built-in method whenever possible:

import {setTimeout} from 'node:timers/promises';

await setTimeout(1000);

v5.0.0...v6.0.0

v5.0.0

01 Feb 15:30
Compare
Choose a tag to compare

Breaking

Improvements

  • Fix missing range() in createWithTimers() return value (#55) f3c7542

v4.4.1...v5.0.0

v4.4.1

30 Jan 07:34
Compare
Choose a tag to compare
  • Loosen up the createWithTimers types df95c9e

v4.4.0...v4.4.1

v4.4.0

18 Jul 14:00
Compare
Choose a tag to compare

v4.3.0

12 Jun 18:14
Compare
Choose a tag to compare

Enhancements:

  • Allow sinon.useFakeTimers() to modify setTimeout() and clearTimeout() (used by delay) after delay loads (#45) 1316fd7

v4.2.0...v4.3.0

v4.2.0

08 Apr 11:02
Compare
Choose a tag to compare
  • Refactor TypeScript definition to CommonJS compatible export (#44) fa2d83c

v4.1.0...v4.2.0

v4.1.0

10 Oct 08:59
Compare
Choose a tag to compare
  • Add delay.createWithTimers() method. e589469
  • Fix TypeScript type definition conflict with React Native. 04ef16f

v4.0.1...v4.1.0

v4.0.0

03 Sep 04:04
Compare
Choose a tag to compare

The value argument is now an options-object.

- await delay(100, '🦄');
+ await delay(100, {value: '🦄'});

And we added support for AbortController.