Skip to content
프로젝트

소개

Hamo means hook, do the math.

웹 및 앱 개발

이 수치를 측정하는 방법

What you can do

  • 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

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

HAMO

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

$ 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

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

MIT © darkroom.engineering

Shoutout

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

관련 프로젝트 살펴보기

불러오는 중…