Closed ltfschoen closed 1 year ago
Why is the
bind!
macro recommended over using thisbind
method?
Because I estimate that the macro is more ergonomic and at this point more stable (less likely to have breaking changes in the future) than the method. For that reason I also prefer to keep the documentation focused on the bind!
macro.
Down the line I'd like to make that macro unnecessary by basically auto-binding event handlers in components, pushing Kobold more towards a proper DSL (which it already kind of is).
In the docs here, it shows how to use
bind!
In the invoice example, I wanted an editable input field, and I wanted to be able to load from a file (like your csv example), and populate the editable fields value with a value from the file, and still have that input field being editable (like your csv example).
But I there were different techniques being used in the examples. After I got it to work I found that the following:
is equivalent to this:
So in the examples the following:
is equivalent to this:
If I have another look at the docs it does show how it's desugered, but it wasn't immediately obvious to me. Could it be beneficial to update the bind docs to show an example with both options using the
state
?