github sindresorhus/debounce v4.0.0

54 minutes ago

Breaking

  • Require Node.js 22 c00dc79
  • Throw a RangeError for a wait that a timer cannot wait for e1fde61
    • This includes NaN, a non-numeric string, and a value larger than 2147483647 (about 24.8 days). Before, NaN did not wait at all, and a larger value re-armed a timer every millisecond.
  • Do not throw when different instances call a debounced method on a shared prototype d782617

Improvements

  • Keep readonly rest parameters in the TypeScript types d782617
    • Before, a debounced (...values: readonly number[]) => … function could not be called.

Fixes

  • Fix .flush() calling the function a second time, with no arguments, after an immediate call d0f2093
  • Fix .trigger() running a call from a wait that already ended in immediate mode d0f2093
  • Fix .trigger() dropping a call that the function makes to its debounced function d0f2093
  • Fix .trigger() running the function a second time if it throws d0f2093

v3.0.0...v4.0.0

Don't miss a new debounce release

NewReleases is sending notifications on new releases.