@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
28 lines (27 loc) • 1.11 kB
JavaScript
import { ApiBase } from '../Implementation/ApiBase';
export class TeamSharingInternalApi extends ApiBase {
getSharedEntryDependencies(sharedEntity) {
const allEntities = this.getTeamSharingApi().getLoadedAdaptableSharedEntities();
return (sharedEntity?.EntityDependencyIds ?? []).map((id) => allEntities.find((entity) => entity.Uuid === id));
}
waitForTeamSharingImportEnd() {
const waitForStableState = 1000;
const waitThreshold = 5000;
return new Promise((resolve, reject) => {
let pollTimer;
let breakTimer = setTimeout(() => {
unsubscribe?.();
clearTimeout(pollTimer);
reject(false);
}, waitThreshold);
const unsubscribe = this.getEventApi().on('AdaptableStateChanged', () => {
clearTimeout(pollTimer);
pollTimer = setTimeout(() => {
unsubscribe();
clearTimeout(breakTimer);
resolve(true);
}, waitForStableState);
});
});
}
}