I upgraded from wrappers 800 to wrappers 819, and ...
# javascript
r
I upgraded from wrappers 800 to wrappers 819, and something about jso changed [incorrect - it was a tightening up of interfaces]. This used to work:
Copy code
jso {
            root = null
            rootMargin = "0px"
            threshold = arrayOf(0.0)
        }
Now these properties are all "val" and cannot be assigned.
t
You can use strict JSO factory for your entity ;)
Name of factory = name of interface
r
Hm, not fully tracking here. So in this case, what would it be?
Copy code
observer = 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)
        })
t
Copy code
IntersectionObserverInit(
    root = null,
    rootMargin = "0px",
    threshold = arrayOf(0.0)
)
r
Ah ok, I get it. (https://github.com/JetBrains/kotlin-wrappers/commit/a1b886cc5c198b9b9dd90b015ab531a14e93ac4f) I wonder why I was using jso in the first place there - these interfaces have existed for a long time. 🤷
t
No worries, JSO factories - new feature ;)