perspectives: added data provider layer

This commit is contained in:
Jan Prochazka
2022-07-21 11:26:44 +02:00
parent 6e6d0bb616
commit 1abfab950e
7 changed files with 77 additions and 19 deletions

View File

@@ -24,7 +24,7 @@
const loadChildNodes = [];
const loadChildRows = [];
const loadProps = node.getNodeLoadProps(parentRows);
const rows = await node.loader(loadProps);
const rows = await node.dataProvider.loadData(loadProps);
// console.log('ROWS', rows, node.isRoot);
if (node.isRoot) {
@@ -67,7 +67,7 @@
await loadLevelData(node, rows);
dataRows = rows;
// console.log('DISPLAY ROWS', rows);
console.log('DISPLAY ROWS', rows);
// const rows = await node.loadLevelData();
// for (const child of node.childNodes) {
// const loadProps = [];
@@ -97,6 +97,8 @@
}
}
onMount(() => {});
$: loadData(root);
$: display = root && dataRows ? new PerspectiveDisplay(root, dataRows) : null;