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
At most, onDomRefresh is a duplicate of onShow and onRender, as it is nearly triggered when both of those are triggered. However, it limits itself to be called only when the element is a child of the document.
Consequently, onAttach will handle the onShow case – and do it in a more robust way – than what onDomRefresh could ever do.
However, onDomRefresh is called when you run render on a view that already exists, whereas onAttach is not called. This is because onAttach only works in conjunction with a region, by design.
Given the primary use case of onAttach – sharing when nested view structures are attached – it'd be impossible to make it work within the render method. It necessarily needs to happen after rendering.
Because of this, I propose that we add a new event: onRefresh. This is called whenever a view is rendered and is a child of the document.
onAttach
will serve the needs of most people, but is it enough to fully replaceonDomRefresh
? This issue is for us to think about that more.An interesting thing to note is that if we get rid of
onDomRefresh
, we might be able to get rid of the internal_rendered
and_shown
properties.The text was updated successfully, but these errors were encountered: