spxbhuhb / adaptive

Consolidated full-stack application development library for Kotlin
Apache License 2.0
0 stars 0 forks source link

Patching after callback #21

Open toth-istvan-zoltan opened 1 month ago

toth-istvan-zoltan commented 1 month ago

Event handlers may change the state of the declaring component:

fun a() {
    var counter = 0
    text("Clicked: $counter time(s)", onClick { counter++ })
}

The plugin does not call genPatchInternal of the declaring component automatically, but the onClick checks if the state is dirty and performs the call if so.

I don't know if it worth the trouble to add this to the plugin. After all, the number of these kind of instructions is quite limited.

Have to think about this and clarify the design.