@studio-freight/hamo

hamo means hook, do the math.

Usage no npm install needed!

<script type="module">
  import studioFreightHamo from 'https://cdn.skypack.dev/@studio-freight/hamo';
</script>

README

HAMO

Introduction

Hamo means hook, you do the math


Features

This toolkit is composed of:

useDebounce – debounce goodness

useDebug – returns true if #debug is present in the url

useEffectOnce – runs a function through react's useEffect with an empty dependency array

useFrame – use @react-spring/rafz animation frame

useInterval – create and dispose intervals

useIsTouchDevice – duh

useIsomophicLayoutEffect – runs react's useLayoutEffect if in browser, if not, runs a plain useEffect instead

useMeasure – measure anything in the dom

useMediaQuery – css-like media query support in Javascript.

useRafState – modify state in sync with @react-spring/rafz

useRect – getboundingclientrect with scrollY sauce if using our lenis smooth scroll

useSlots – brings vue slots to react

useTimeoutFn – timeout a function

useUnmount – calls unmount callbacks.

useWindowSize – window sizing updated in sync with @react-spring/rafz


Authors

This set of hooks is curated and maintained by the Studio Freight Darkroom team:


License

The MIT License.