@darkroom.engineering/hamo
Advanced tools
Comparing version 1.0.0-dev.1 to 1.0.0-dev.2
@@ -113,2 +113,23 @@ import * as react from 'react'; | ||
export { type Rect, useLazyState, useMediaQuery, useObjectFit, useRect, useResizeObserver, useTimeout, useWindowSize }; | ||
/** | ||
* @name useIntersectionObserver | ||
* @description A React hook that oberves element visibility using IntersectionObserver. | ||
* @param {HTMLElement} root (optional) | ||
* @param {string} rootMargin (optional, default: `0px`) | ||
* @param {number} threshold (optional, default: `0`) | ||
* @param {boolean} once (optional, default: `false`) | ||
* @param {boolean} lazy (optional, default: `false`) | ||
* @param {function} callback (optional) | ||
* @param {array} deps (optional) | ||
* @returns {array} [setElement, entry] | ||
*/ | ||
declare function useIntersectionObserver({ root, rootMargin, threshold, once, lazy, callback, }?: { | ||
root?: HTMLElement | null; | ||
rootMargin?: string; | ||
threshold?: number; | ||
once?: boolean; | ||
lazy?: boolean; | ||
callback?: (entry: IntersectionObserverEntry | undefined) => void; | ||
}, deps?: never[]): readonly [react.Dispatch<react.SetStateAction<HTMLElement | null | undefined>>, IntersectionObserverEntry]; | ||
export { type Rect, useIntersectionObserver, useLazyState, useMediaQuery, useObjectFit, useRect, useResizeObserver, useTimeout, useWindowSize }; |
{ | ||
"name": "@darkroom.engineering/hamo", | ||
"version": "1.0.0-dev.1", | ||
"version": "1.0.0-dev.2", | ||
"description": "hamo means hook, do the math.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -5,3 +5,3 @@ [](https://github.com/darkroomengineering/hamo) | ||
`hāmō` means hook in Latin, this package is a collection of custom React hooks. | ||
`hāmō` means hook in Latin, this package is a collection of custom performance-oriented React hooks. | ||
@@ -8,0 +8,0 @@ ## Installation |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
52742
527
0