UseX is a collection of hook utilities for quick and smart development.
Hook utility
encapsulates a batch of reusable logic. It usually starts with use
.
Only for Browser Env!
npm i @gstarp/usex
Then you can directly import hook utilities and use.
import { useMultipleClick } from '@gstarp/usex'
useMultipleClick(el, cb)
You can build source code to get dist file, which is also included in the package installed via npm.
git clone [email protected]:GStarP/UseX.git
cd usex
npm i
npm run build
Then you can import dist/usex.min.js
in .html
file and acceess hook utilities by UseX
.
<script src="usex.min.js"></script>
<script>
UseX.useMultipleClick(el, cb)
</script>
Hooks in reactive
dir can provide reactive variants for your reactive rendering. They are based on @vue/reactivity
, so you must install this dependency to use reactive hooks.
Make sure the version of
vue
and@vue/reactivity
is the same, otherwise you will have to do some extra work.
You can also use reactive hooks even if you don't install vue
, which means you can use them along with react
or whatever. I will write an example to prove it's feasibility.