Track whether an element is currently in (or near) the viewport.
A live signal: it flips back to false when the element scrolls away, so
callers can cancel pending work for off-screen items. The rootMargin
buffer keeps the flag stable for elements hovering at the viewport edge.
Track whether an element is currently in (or near) the viewport.
A live signal: it flips back to
falsewhen the element scrolls away, so callers can cancel pending work for off-screen items. TherootMarginbuffer keeps the flag stable for elements hovering at the viewport edge.