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
In most cases, defining actions under $jason.head.actions and calling them via trigger is recommended.
This is because if we ever happen to pass around dynamic arguments, these template expressions may get instantiated on view render and will baked into the view.
For example, in the following case we want to display an alert with the local variable val at the time of user tap.
However what actually happens is: this will get rendered at load time with the val value at the time of render. Then this action is not dynamic anymore because all its arguments have been instantiated. This is why it's recommended that you put all actions under head.actions so that these don't get instantiated at view render.
But this point can be confusing for people new to the framework.
So this issue is for figuring out how to deal with this problem. Could be through better documentation, could be through some sort of warning messages, something else, or all of the above.
The text was updated successfully, but these errors were encountered:
In most cases, defining actions under
$jason.head.actions
and calling them viatrigger
is recommended.This is because if we ever happen to pass around dynamic arguments, these template expressions may get instantiated on view render and will baked into the view.
For example, in the following case we want to display an alert with the local variable
val
at the time of user tap.However what actually happens is: this will get rendered at load time with the
val
value at the time of render. Then this action is not dynamic anymore because all its arguments have been instantiated. This is why it's recommended that you put all actions underhead.actions
so that these don't get instantiated at view render.But this point can be confusing for people new to the framework.
So this issue is for figuring out how to deal with this problem. Could be through better documentation, could be through some sort of warning messages, something else, or all of the above.
The text was updated successfully, but these errors were encountered: