https://kotlinlang.org logo
#compose
Title
# compose
s

SrSouza

02/21/2020, 12:53 AM
The composable have a ID that I can get? and three's any callback that I can set when my composable is removed from the SlotTable?
l

Leland Richardson [G]

02/21/2020, 12:58 AM
ID: not really. what is it you’re trying to do? callback: Yes. you could use
onDispose
for this
s

SrSouza

02/21/2020, 1:03 AM
I want to try make compose work in Kotlin JS
l

Leland Richardson [G]

02/21/2020, 1:05 AM
neat. what causes the id requirement for that?
s

SrSouza

02/21/2020, 1:07 PM
I read that React uses keys, but thinking better now, I could use remember to cache the exacly element. The truth is that I have zero background in Frontend but I see that the Compose could be great three too and I want a study more the under hoods of compose in this carnival.
l

Leland Richardson [G]

02/21/2020, 5:29 PM
if you really want to go down this path, i’d be happy to chat and brainstorm a little bit more about what might be involved. i don’t think you’d need anything special with keys, based on how our runtime works. My guess is if you got compose runtime to compile to kotlin JS, you’d already be very close. After that, the primary thing would be to build a scheduler and a
Composer
subclass that knew how to target DOM nodes. Then you’d want to figure out the right way to expose those DOM nodes to the type system (there’d be a couple of options here i think)
3 Views