MVVM - Introduce the concept of disposables to track event listeners, sub vms and so on (#30475)

* Introduce disposables to track sub vms and event listeners

* Remove old code

* Use disposable in BaseViewModel

* Update vm so that the listener is tracked through disposable

* No-op on dispose call instead of throwing error

* Throw error in trackListener as well

* Fix audio player vm

* Expose isDisposed through base vm

* Dispose AudioPlayerViewModel
This commit is contained in:
R Midhun Suresh
2025-08-25 09:19:24 +00:00
committed by GitHub
parent df9dfaf16f
commit 427cddb8e5
7 changed files with 150 additions and 65 deletions
@@ -74,6 +74,7 @@ export default class MAudioBody extends React.PureComponent<IBodyProps, IState>
public componentWillUnmount(): void {
this.state.playback?.destroy();
this.state.audioPlayerVm?.dispose();
}
protected get showFileBody(): boolean {