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 \\ ------------ const is setIs toggle = ------------ // or \\ ------------ const is setIs toggle =
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.