Provides useful Halogen Hooks and other utilities commonly used in hooks (e.g. actions).
useDebouncer
- run an action only when a specified amount of time has passed without receiving any new updats/values (e.g. search the database using user's query after 300 ms of no input).useThrottle
- run an action with the next value after ignoring new values for a specified amount of time (e.g. handle 1 scroll event every 300 ms).useEvent
- run a callback whenever a new value is pushed (e.g. allow a library to publish events within it to end-users of the library).useStateFn
- use thestate /\ modifyState <- useState
behavior that was implemented inhalogen-hook
v0.3.0
and then reverted inv0.4.0
.useGet
- ensure you aren't getting/using "stale" values (e.g. running finalizers inEffect
ful code or running asynchronous code).
- Reduce boilerplate when calling
preventDefault
on mouse events and key events.
# Compile the examples
spago -x examples.dhall bundle-app --main Examples.Main --to dist/app.js
# Then open the `dist/index.html` file in your favorite browser
# firefox dist/index.html
# google-chrome dist/index.html