JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1104
  • Score
    100M100P100Q13508F
  • License MIT

hamo means hook, do the math.

Package Exports

  • @darkroom.engineering/hamo
  • @darkroom.engineering/hamo/dist/hamo.d.ts
  • @darkroom.engineering/hamo/dist/hamo.mjs
  • @darkroom.engineering/hamo/dist/hamo.mjs.map

Readme

HAMO

Introduction

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

Installation

$ npm i @darkroom.engineering/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