Destroy view-models when destroying trees
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Destroyable } from '../../../backend/src/Model/Destroyable'
|
||||
import { EventDispatcher } from '../../../events'
|
||||
|
||||
export class TopicViewModel {
|
||||
export class TopicViewModel implements Destroyable {
|
||||
private selected: boolean
|
||||
public change = new EventDispatcher<void, TopicViewModel>()
|
||||
|
||||
@@ -8,6 +9,10 @@ export class TopicViewModel {
|
||||
this.selected = false
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
this.change.removeAllListeners()
|
||||
}
|
||||
|
||||
public isSelected() {
|
||||
return this.selected
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user