Skip to content

Latest commit

 

History

History
35 lines (19 loc) · 1.31 KB

README.md

File metadata and controls

35 lines (19 loc) · 1.31 KB

HAMO

Introduction

hāmō means hook in Latin, this package is a collection of custom performance-oriented React hooks.

Installation

$ npm i hamo

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

useTimeout – runs a callback after a specified delay

useObjectFit – calculates the x and y scale of an object based on its parent width and height

useIntersectionObserver – observes element intersection with the viewport

License

MIT © darkroom.engineering

Shoutout

Thank you to Luca Gesmundo for having transfered us the npm package name 🙏.