@gadeoli/rjs-hooks-library
v0.2.12
Published
Some hooks for reactJS apps in one place
Readme
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
- useCabinet (A boolean array control like a file cabinet)
- useElementSize (Get element sizes using ref)
- useGhostInFirstRender (A negative boolean value that is setted positive after first render and a small delay)
- useHover (control when a element is hovererd using ref)
- useImagePreloader
- useInViewPort
- useOnClickOutside (Listen when clicked outside component using ref)
- useOnInfiniteScrollTrigger (Trigger a function when "reffed" element shows up)
- useOnPressKey (An event handler to trigger an action by key press using ref)
- usePersistedState (An option to persist state in local storage)
- usePrevious (Keep state value between current and previous render)
- useTimer (a count down minute / seconds)
- useWindowSize (Get window sizes)
Use
import {useElementSize} from '@gadeoli/rjs-hooks-library';How to maintain
- Clone
- NVM use 22.13.1 (node 22.13.1 / npm 10.9.2)
- npm i
- make changes
- git add / git commit / git push
- npm run publish (custom command)
Sources
useElementSize
useHover
useOnClickOutside
usePersistedState
usePrevious
useWindowSize
useTimer
useClickOutside
useOnPressKey
useGhostInFirstRender
useOnInfiniteScrollTrigger
[useCabinet] ChatGPT
some sources could be missing
Changes
- useOnpressKey: added modifierKey support
