Tags: Tiamat-Tech/react-intersection-observer
Tags
fix: use WeakMap to avoid memory leak (thebuilder#463) IntersectionObserver roots were tracked in a Map. This ensures it's possible to reuse the Intersection Observer instance if they share the same options. Changed to use a WeakMap, so unused root elements can be garbage collected. Closes thebuilder#462
feat: add support for testing threshold values (thebuilder#417) This expands the `test-utils` to support defining a `threshold` value when checking for `isIntersecting`. Before you could only give a `boolean`. This should allow you test more complex `threshold` based scenarios.
fix: ensure thresholds is defined (thebuilder#415) Sometimes the thresholds value on the IntersectionObserver instance could be undefined. Add a fallback to a default value in the cases where the browser doesn't set it. This fixes thebuilder#414
PreviousNext