Subscribe to onDispose
event.
This event is triggered whenever the object is disposed.
A component can only be disposed by the end user, by calling the dispose
method on the component or the component which owns it.
// Example usage
Dashboard.onDispose(() => {
console.log('Dashboard was disposed')
})
Dashboard.dispose()
Token of subscription
Handler function for event
Interface for event methods for tracking when an object is disposed.