class Foo extends View {
@:state var bar = 1;
function render() '
<div>
<Child onblub={bar++} />
<span>{bar}</span>
</div>
';
}
The blub event handler is a function that always does the same thing, but at every rerender a new function gets created, thus invalidating the view.
For anonymous functions, it should be possible to find out which variables they capture (in this case none) and then use those (and the string represenation of the function's AST) as a cache key. For example in TodoMVC the item and function (event) todos.delete(item) would be the cache key.
Given this view:
The blub event handler is a function that always does the same thing, but at every rerender a new function gets created, thus invalidating the view.
For anonymous functions, it should be possible to find out which variables they capture (in this case none) and then use those (and the string represenation of the function's AST) as a cache key. For example in TodoMVC the item and
function (event) todos.delete(item)
would be the cache key.