bjork_react-hookup

2.0.52 • Public • Published

🍻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.

Licence

MIT

Package Sidebar

Install

npm i bjork_react-hookup

Weekly Downloads

6

Version

2.0.52

License

MIT

Unpacked Size

30.1 kB

Total Files

20

Last publish

Collaborators

  • emileinarsen