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

0.2.0 • Public • Published

RJS Hooks Library

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

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';

How to maintain

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

Sources

useElementSize
useHover
useOnClickOutside
usePersistedState
usePrevious
useWindowSize
useTimer
useClickOutside
useOnPressKey
some sources could be missing

Readme

Keywords

Package Sidebar

Install

npm i @gadeoli/rjs-hooks-library

Weekly Downloads

5

Version

0.2.0

License

MIT

Unpacked Size

21.5 kB

Total Files

46

Last publish

Collaborators

  • gadeoli