Reuben Firmin
10/17/2024, 6:21 PMjso {
root = null
rootMargin = "0px"
threshold = arrayOf(0.0)
}
Now these properties are all "val" and cannot be assigned.turansky
10/17/2024, 6:48 PMturansky
10/17/2024, 6:48 PMReuben Firmin
10/17/2024, 6:53 PMobserver = IntersectionObserver({ entries, _ ->
entries.forEach { entry ->
if (entry.isIntersecting) {
val id = entry.target.id
displayCallbacks.find { it.first == id }?.second?.invoke()
observer.unobserve(entry.target)
displayCallbacks.removeAll { it.first == id }
}
}
}, object: IntersectionObserverInit {
root: null
rootMargin: "0px"
threshold: arrayOf(0.0)
})
turansky
10/17/2024, 6:55 PMIntersectionObserverInit(
root = null,
rootMargin = "0px",
threshold = arrayOf(0.0)
)
Reuben Firmin
10/17/2024, 7:07 PMturansky
10/17/2024, 7:11 PMturansky
10/17/2024, 7:12 PM