paoloconte
11/02/2021, 2:12 PMval counter = ObservableValue(0)
simplePanel().bind(counter) { count ->
span("Counter is $count")
}
When the value of counter changes, the span element gets removed from the dom and a new one is created.
Using snabbdom directly, instead, when the state changes, it traverses the existing dom and make changes to itRobert Jaros
11/02/2021, 2:23 PMRobert Jaros
11/02/2021, 2:23 PMRobert Jaros
11/02/2021, 2:24 PMRobert Jaros
11/02/2021, 2:26 PMRobert Jaros
11/02/2021, 2:28 PMRobert Jaros
11/02/2021, 2:31 PMRobert Jaros
11/02/2021, 2:50 PMskey
property to all components. With this code:
simplePanel().bind(counter) { count ->
span("Counter is $count") {
skey = "mykey"
}
}
user will be able to define it's own key and snabbdom will not recreate component's node.paoloconte
11/02/2021, 3:03 PMRobert Jaros
11/04/2021, 2:37 PMpaoloconte
11/04/2021, 5:56 PMpaoloconte
11/05/2021, 9:12 AM