Allow "On dispose" actions for pages and components

Feedback

It would be great to have actions that can be set when a page/component is disposed of, similar to page initialization actions.

For example I run custom code to set up subscriptions when a page is initialized, but I can't cancel the subscriptions when the page is closed.

The only workaround I know is to wrap the component in a custom widget and to control the dispose logic there, but that's not ideal. Are there other methods?

4
2 replies