mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +01:00
some minor TODOs for template view improvements
This commit is contained in:
parent
cd93077731
commit
141cf95eac
@ -41,11 +41,13 @@ function objHasFns(obj) {
|
|||||||
export class TemplateView {
|
export class TemplateView {
|
||||||
constructor(value, render = undefined) {
|
constructor(value, render = undefined) {
|
||||||
this._value = value;
|
this._value = value;
|
||||||
|
// TODO: can avoid this if we have a separate class for inline templates vs class template views
|
||||||
this._render = render;
|
this._render = render;
|
||||||
this._eventListeners = null;
|
this._eventListeners = null;
|
||||||
this._bindings = null;
|
this._bindings = null;
|
||||||
this._subViews = null;
|
this._subViews = null;
|
||||||
this._root = null;
|
this._root = null;
|
||||||
|
// TODO: can avoid this if we adopt the handleEvent pattern in our EventListener
|
||||||
this._boundUpdateFromValue = null;
|
this._boundUpdateFromValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,6 +326,8 @@ class TemplateBuilder {
|
|||||||
return new TemplateView(this._value, (t, vm) => {
|
return new TemplateView(this._value, (t, vm) => {
|
||||||
const rootNode = renderFn(mappedValue, t, vm);
|
const rootNode = renderFn(mappedValue, t, vm);
|
||||||
if (!rootNode) {
|
if (!rootNode) {
|
||||||
|
// TODO: this will confuse mapView which assumes that
|
||||||
|
// a comment node means there is no view to clean up
|
||||||
return document.createComment("map placeholder");
|
return document.createComment("map placeholder");
|
||||||
}
|
}
|
||||||
return rootNode;
|
return rootNode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user