()
| 67 | const activeIntersections = new WeakMap<Element, VoidFunction>() |
| 68 | |
| 69 | const onEnter = () => { |
| 70 | if (to) { |
| 71 | // @ts-expect-error – TODO: fix this type error |
| 72 | api.start(to) |
| 73 | } |
| 74 | |
| 75 | setIsInView(true) |
| 76 | |
| 77 | const cleanup = () => { |
| 78 | if (from) { |
| 79 | api.start(from) |
| 80 | } |
| 81 | setIsInView(false) |
| 82 | } |
| 83 | |
| 84 | return once ? undefined : cleanup |
| 85 | } |
| 86 | |
| 87 | const handleIntersection: IntersectionObserverCallback = entries => { |
| 88 | entries.forEach(entry => { |
no test coverage detected
searching dependent graphs…