perspective loader class

This commit is contained in:
Jan Prochazka
2022-07-21 12:33:29 +02:00
parent 1abfab950e
commit 35152a2796
6 changed files with 181 additions and 69 deletions

View File

@@ -1,3 +1,4 @@
import { PerspectiveDataLoader } from './PerspectiveDataLoader';
import { PerspectiveDataLoadProps } from './PerspectiveTreeNode';
export interface PerspectiveDataCache {}
@@ -6,9 +7,12 @@ export class PerspectiveDataProvider {
constructor(
public cache: PerspectiveDataCache,
public setCache: (value: PerspectiveDataCache) => void,
public loader: (props: PerspectiveDataLoadProps) => Promise<any[]>
public loader: PerspectiveDataLoader
) {}
async loadData(props: PerspectiveDataLoadProps) {
return await this.loader(props);
async loadData(props: PerspectiveDataLoadProps): Promise<{ rows: any[]; incomplete: boolean }> {
return {
rows: await this.loader.loadData(props),
incomplete: true,
};
}
}