@gadeoli/rjs-hooks-library
TypeScript icon, indicating that this package has built-in type declarations

0.0.21 • Public • Published

RJS Hook Library

Some (almost all) hooks has been copied from internet foruns. If necessary look from source info to check who created the hook.

How to maintain

  1. Clone
  2. NVM use 16.14.2 (node 16.14.2 / npm 8.5.0)
  3. npm i
  4. make changes
  5. git add / git commit / git push
  6. npm run publish (custom command)

Hooks

  • useElementSize (Get element sizes using ref)
  • useHover (control when a element is hovererd using ref)
  • useOnClickOutside (Listen when clicked outside component using ref)
  • usePersistedState (An option to persist state in local storage)
  • usePrevious (Keep state value between current and previous render)
  • useWindowSize (Get window sizes)
  • useTimer (a count down minute / seconds)
  • useClickOutside (An event handler to trigger an action by outside-click-element using ref)
  • useOnPressKey (An event handler to trigger an action by key press using ref)

Use

import {useElementSize} from '@gadeoli/rjs-hooks-library';

Sources

useElementSize
useOnClickOutside
usePersistedState
usePrevious
useTimer useWindowSize
useClickOutside
useOnPressKey

Package Sidebar

Install

npm i @gadeoli/rjs-hooks-library

Weekly Downloads

1

Version

0.0.21

License

MIT

Unpacked Size

21.4 kB

Total Files

46

Last publish

Collaborators

  • gadeoli