Svelte actions should return a destroy function
An IntersectionObserver created in an action outlives the element unless the action returns `{ destroy }`.
export const reveal: Action<HTMLElement> = (node) => {
const observer = new IntersectionObserver(/* … */);
observer.observe(node);
return { destroy: () => observer.disconnect() };
}; Without the destroy, client-side navigation leaves observers attached to
detached nodes. Harmless at first, a leak after fifty page views.