remove support for observablevalues from templateview

it's not used, and so params haven't been standardized
trying to unify it, it messes up overriding update in RoomView
that extends it to set the timelineViewModel upon update.
This commit is contained in:
Bruno Windels 2020-05-04 22:24:49 +02:00
parent d6645cbba9
commit d70a57a7c9

View file

@ -40,14 +40,10 @@ export class TemplateView {
}
_subscribe() {
this._boundUpdateFromValue = this._updateFromValue.bind(this);
if (typeof this._value.on === "function") {
this._boundUpdateFromValue = this._updateFromValue.bind(this);
this._value.on("change", this._boundUpdateFromValue);
}
else if (typeof this._value.subscribe === "function") {
this._value.subscribe(this._boundUpdateFromValue);
}
}
_unsubscribe() {
@ -55,9 +51,6 @@ export class TemplateView {
if (typeof this._value.off === "function") {
this._value.off("change", this._boundUpdateFromValue);
}
else if (typeof this._value.unsubscribe === "function") {
this._value.unsubscribe(this._boundUpdateFromValue);
}
this._boundUpdateFromValue = null;
}
}
@ -103,17 +96,14 @@ export class TemplateView {
v.unmount();
}
}
if (typeof this._value.dispose === "function") {
this._value.dispose();
}
}
root() {
return this._root;
}
_updateFromValue() {
this.update(this._value);
_updateFromValue(changedProps) {
this.update(this._value, changedProps);
}
update(value) {