{"repo":"darkroomengineering/hamo","free":true,"listed":false,"github":"https://github.com/darkroomengineering/hamo","clone":"git clone https://github.com/darkroomengineering/hamo.git","description":"Hamo means hook, do the math.","language":"TypeScript","stars":313,"topics":["hooks","react","darkroom-engineering"],"license":"MIT","category":"ui-components","readme_excerpt":"Introduction hāmō means hook in Latin, this package is a collection of custom performance-oriented React hooks. Features - Render-safe hooks — a small, tree-shakeable set of performance-oriented React hooks - Measurement hooks — useRect, useWindowSize, and useResizeObserver track element and viewport size without thrash - useIntersectionObserver — fire when elements enter or leave the viewport - useLazyState — update a value through a callback without triggering a re-render - Debounce hooks — useDebouncedCallback, Effect, and State debounce from one primitive - useObjectFit — compute object-fit scale from a parent's dimensions Installation Hooks useRect – tracks element position within the page useWindowSize – tracks window dimensions useResizeObserver – observes element dimensions using ResizeObserver useLazyState – runs a callback when the state changes without re-rendering the component useDebouncedCallback/useDebouncedEffect/useDebouncedState – debounces a callback, effect, or state useObjectFit – calculates the x and y scale of an object based on its parent width and height useIntersectionObserver – observes element intersection with the viewport useMediaQuery – detects whether a media query matches useEffectEvent – polyfill for React's experimental useEffectEvent, returns a stable function that always calls the latest callback useScrollTrigger – high-performance scroll progress tracker useTransform – context-based transform accumulation across the component tree License","default_branch":null,"files":null,"tree":[],"storefront":"/r/darkroomengineering","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/darkroomengineering/hamo/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}