Skip to content

v2.9.0

Choose a tag to compare

@github-actions github-actions released this 05 Aug 13:42
· 234 commits to main since this release
d5aea56

@jbpark/use-hooks 2.9.0

This release includes several minor improvements to the useDebounce, useViewport, useLocalStorage, and useRecursiveTimeout hooks.

Added

  • A new leading option to useDebounce to control whether the first invocation fires immediately or after the specified delay.
  • Same-tab sync support for useLocalStorage to enable seamless updates across related components in the same tab.
  • A new stopOnError option to useRecursiveTimeout to control whether a rejected callback stops the polling loop or schedules the next tick.

Changed

  • useViewport now returns a fresh, plain-object snapshot of the viewport on every read, rather than the mutable window.visualViewport instance.

What's Changed

  • 🐛 fix: stop useDebounce from using stale delay/args and unsound types by @pjb0811 in #92
  • 🐛 fix: stop useViewport from returning a stale VisualViewport reference by @pjb0811 in #93
  • 🐛 fix: move localStorage write out of the state updater, add same-tab sync by @pjb0811 in #94
  • 🐛 fix: correct callback type, delay=0, and rejection handling in useRecursiveTimeout by @pjb0811 in #95
  • 🔖 chore: version packages by @github-actions[bot] in #96

Full Changelog: v2.8.0...v2.9.0