there is no event handling inside VElement
# kmdc
r
there is no event handling inside VElement
b
It's implemented as a module. Handlers themselves are stored in moduleData oblect and managed by the module. Theres "on" helper dsl function
Or just use kotlinx-html handles
r
It won't be that simple in KVision
b
You can push it directly to module data if you want. Each VElement has getModuleData function to fetch component's module data for each module
r
probably it can be copied
and somehow remapped to kvdom "on"
b
There's an equivalent in kotlinx-html. I can find it for you tomorrow when I get back to my pc
r
I wonder if it's a good idea to mix kotlinx-html and kvision dsl in one project
what is
kvdom-dom
?
a multiplatform abstraction of the real dom?
do I understand correctly that only kvdom-core is required for integration with JS project like kvision?
b
Kvdom-dsl is optional
Kvdom-dom brings kotlinx dom bindings to common sourceSet and typealiases it back on js while providing implementations on wasm
kvdom-core is the only required dependency (which itself depends on kvdom-dom)
@Robert Jaros can you send me a link to kvision code that interacts with these event handling hooks?
two such maps to be accurate
and these maps are converted to snabbdom event listeners
those are maps of maps of functions to allow multiple listeners
ant the whole code is complicated as hell 🙂
that's because snabbdom-kotlin bindings don't have simple
addListener(String, (Event) -> Unit)
function, but this type safe
On
interface.
b
Looks like kvdom might make things easier in this regard