bjork_react-hookup
v2.0.52
Published
A React Hooks utility library containing custom hooks/data structures
Downloads
19
Maintainers
Readme
🍻React-hookup
A React Hooks utility library containing custom hooks/data structures
⚙Install
Use npm to install react-hookup.
> npm i bjork_react-hookup
🔥Usage
------------ // for example \\ ------------
import { useBoolean } from 'bjork_react-hookup'
const [ is, setIs, { toggle } ] = useBoolean(true)
------------ // or \\ ------------
import useBoolean from 'bjork_react-hookup/core/useBoolean'
const [ is, setIs, { toggle } ] = useBoolean(true)
🧰Hook Documentation
| Name | Returns | Arguments |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------------- |
| 💡useActive
| [ isActive, bind ] | |
| 📋useArray
| [ array, setArray, methods ] | ( initial ) |
| ⏳useAsync
| [ state, execute ] | ( asyncFunction, immediate ) |
| 🎭useBoolean
| [ is, setIsByBoolean, methods ] | ( initial ) |
| 🏀useDebounce
| [ state, setStateByDebounce ] | ( initial ) |
| ⌨useField
| [ value, setValue, bind ] | ( initial ) |
| 🔦useFocus
| [ isFocus, bind ] | |
| 👻useHover
| [ isHover, bind ] | |
| ⌚useMemento
| [ state, methods ] | ( options? ) |
| 📑useObject
| [ object, setObject, methods ] | ( initial ) |
| 🖱useOnClickOutside
| | ( ref, func ) |
| 🤏useScreenType
| [ type ] | |
| 💾useStorage
| [ item, setItem ] | ( type, key, initialValue ) |
| 🥁useThrottle
| [ state, setStateByThrottle ] | ( initial ) |
| 🧭useWindowScroll
| [ coordiantes, setCoordinatesAndScrollTo ] | |
| ↕useWindowSize
| [ size ] | |
👨💻Contribution
Pull requests are welcome. For any considerable changes, please open an issue first to discuss what you would like to change.