forked from mystiq/hydrogen-web
append all list items at once for initial render
This commit is contained in:
parent
1c779cf95c
commit
df8d884d91
1 changed files with 3 additions and 1 deletions
|
@ -102,12 +102,14 @@ export class ListView {
|
||||||
}
|
}
|
||||||
this._subscription = this._list.subscribe(this);
|
this._subscription = this._list.subscribe(this);
|
||||||
this._childInstances = [];
|
this._childInstances = [];
|
||||||
|
const fragment = document.createDocumentFragment();
|
||||||
for (let item of this._list) {
|
for (let item of this._list) {
|
||||||
const child = this._childCreator(item);
|
const child = this._childCreator(item);
|
||||||
this._childInstances.push(child);
|
this._childInstances.push(child);
|
||||||
const childDomNode = child.mount(this._mountArgs);
|
const childDomNode = child.mount(this._mountArgs);
|
||||||
this._root.appendChild(childDomNode);
|
fragment.appendChild(childDomNode);
|
||||||
}
|
}
|
||||||
|
this._root.appendChild(fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdd(idx, value) {
|
onAdd(idx, value) {
|
||||||
|
|
Loading…
Reference in a new issue