提交 3ccc7a9a 编写于 作者: J Joao Moreno

async data source can be sync

上级 75d5bc40
......@@ -468,7 +468,7 @@ export class AsyncDataTree<T extends NonNullable<any>, TFilterData = void> imple
this._onDidChangeNodeState.fire(node);
}, _ => null);
return this.dataSource.getChildren(node.element)
return Promise.resolve(this.dataSource.getChildren(node.element))
.then(children => {
slowTimeout.cancel();
node.state = AsyncDataTreeNodeState.Loaded;
......
......@@ -147,7 +147,7 @@ export interface ITreeNavigator<T> {
export interface IAsyncDataSource<T extends NonNullable<any>> {
hasChildren(element: T | null): boolean;
getChildren(element: T | null): Promise<T[]>;
getChildren(element: T | null): T[] | Promise<T[]>;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册