You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've added 2 event handlers in our mount function.
455
445
456
-
To create **add** handler `bind2` helper is used.
457
-
This is similar as `bind` but allows to use 2 parameters during the call. There are also helpers for 3 and 4 parameters.
446
+
To create **add** handler, a `transaction` function is used. It allows to do more modifications in one run, and also allows to use more values at the same time.
447
+
448
+
> Keep in mind though, that values are kept the same during transaction, and only changed during next graph recalculation.
449
+
>
450
+
> Transaction provides `Context` which allows you to unwrap `Value` for the time of transaction and use it as a regular variable (`get(ctx)`[^subscription] method on a `Value`).
458
451
459
-
For input **change** event, the `call_param` method is used to create a handler that takes value from the DOM during the call (`new_value` parameter). The type of the value is specialized after applying it in `dom!` macro.
452
+
For input **change** event, we are getting `new_value` in the closure. This is a value passed from DOM when executing event handler. The type of the value is specialized after applying it in `dom!` macro.
0 commit comments