https://kotlinlang.org logo
#getting-started
Title
# getting-started
d

Darryl Miles

03/16/2024, 5:31 PM
I am doing this technically in WasmJs target and I do not know enough about Kotlin/JS target, but can you add `.... { event: Event -> ...``
🧵 1
r

Ray Rahke

03/16/2024, 5:31 PM
Yeah I do that, but then I get errors about
Event
being unreferenced
Unresolved reference: Event
I am not sure where it is expecitng me to import
I am doing the w3c.dom.*
and kotlinx.browser.window
kotlinx.browser.document
d

Darryl Miles

03/16/2024, 5:32 PM
Can you make a test case in https://play.kotlinlang.org ?
r

Ray Rahke

03/16/2024, 5:34 PM
d

Darryl Miles

03/16/2024, 5:37 PM
import org.w3c.dom.events.Event
?
Kotlin/JS seems pedantic about that "options: dyamic" being specified, it should really allow it not to be
r

Ray Rahke

03/16/2024, 5:41 PM
guess I was also mispelling the code
("load') { } versus of ("load", { }
d

Darryl Miles

03/16/2024, 5:44 PM
Maybe you can write an extension function... I'd do something like this https://pl.kotl.in/YTO0nUtqf
It should probably be added to
EventTarget
type not Window 🙂
This is a better version on EventTarget https://pl.kotl.in/voLD4c1ad