Repository navigation
v2.9.0
@jbpark/use-hooks 2.9.0
This release includes several minor improvements to the useDebounce, useViewport, useLocalStorage, and useRecursiveTimeout hooks.
Added
- A new
leadingoption touseDebounceto control whether the first invocation fires immediately or after the specified delay. - Same-tab sync support for
useLocalStorageto enable seamless updates across related components in the same tab. - A new
stopOnErroroption touseRecursiveTimeoutto control whether a rejected callback stops the polling loop or schedules the next tick.
Changed
useViewportnow returns a fresh, plain-object snapshot of the viewport on every read, rather than the mutablewindow.visualViewportinstance.
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