Performance hacks

This commit is contained in:
Pieter Vander Vennet 2022-01-06 18:51:52 +01:00
parent 686fb29ed3
commit 7090a5ceb8
15 changed files with 167 additions and 93 deletions

View file

@ -8,10 +8,19 @@ export class VariableUiElement extends BaseUIElement {
super();
this._contents = contents;
}
Destroy() {
super.Destroy();
this.isDestroyed = true;
}
protected InnerConstructElement(): HTMLElement {
const el = document.createElement("span");
const self = this;
this._contents.addCallbackAndRun((contents) => {
if(self.isDestroyed){
return true;
}
while (el.firstChild) {
el.removeChild(el.lastChild);
}