Closed Xumeiquer closed 3 years ago
I believe so, although I don't know if this is true. From what I know, first, it will call c.SetPrice(event)
. Then, using the updated data, it will re-render the page.
Yes. It probably should be stated more explicitly on this page https://www.vugu.org/doc/dom-events but this should work as you are expecting. There are two things that cause a re-render: 1. Any DOM event, as soon as the handler exits causes a re-render, or 2. You can use EventEnv.Lock()/UnlockRender() to tell it to explicitly re-render (useful from goroutines).
In your example above c.SetPrice(event)
will be called and as soon as it exits a render will occur and c.Price()
will be called again.
Nice, really nice. Thank you for the explanation.
Question I would like to know if there are any kind of reactivity in Vugu. For example, imagine the following code:
Will the
c.Price()
be called after thec.SetPrice
sets a value on a interval variable (the same one the usesc.Price
)?Is your question related to a problem? Please describe. No, as far as I know
Suggested Changes None at the moment
Additional context Nothing.