Skip to content

1.2.0

Choose a tag to compare

@senthilkumar979 senthilkumar979 released this 16 Oct 15:58
· 17 commits to main since this release

usethishook 1.2.0

Minor release: seven new hooks, optional custom locales for useAmountInput, and playground New badges. No breaking changes. The library now ships 40 typed hooks.

npm i usethishook@^1.2.0

Playground: usethishook.mentorbridge.in

State

  • useSessionStorage — JSON state in sessionStorage (same shape as useLocalStorage)
  • useThrottle — throttle a value (leading + trailing)

Browser

  • useScrollLock — lock / unlock document.body scroll for overlays
  • useDocumentVisibility — Page Visibility API (visible | hidden)
  • useIdle — true after a period of no user activity

App

  • useThrottledCallback — throttle a function, with cancel
  • useUpdateEffect — like useEffect, but skips the initial mount

Forms

  • useAmountInput — optional locales map to register or override separators beyond built-in en / de / nl / fr
  • Exported AmountLocaleConfig type