Closed haynesjm42 closed 5 months ago
This looks like a fantastic ticket. In theory, you could imagine building it deeper into the framework, but I am hoping that building it into TabContainer will be a sweet spot for adding the most useful functionality with minimal complexity.
Very curious to know how you might be able to support parts of this lifecycle even in the case of a non-route enabled tab container.
Also -- assuming these hooks would be looked for on the Contents of the Tab, rather than the TabModel?
@haynesjm42 here is another candidate for Hoist work next week.
To bring TabContainer in line with framework routing libraries and to generally reduce the amount of wiring it takes to use routing it would be nice to have some hooks in place to help streamline the process of setting up routable components.
onActivate(params)
onDeactivate
onActivate
but would allow a hook for a Tab to suspend some process if neededcanActivate(params)
canDeactivate
See https://router5.js.org/advanced/preventing-navigation for how to implement
canActivate
andcanDeactivate
with router5.Also for reference see https://aurelia.io/docs/fundamentals/cheat-sheet#routing for details on how these same hooks work in the Aurelia router.