Skip to content

Commit

Permalink
feat: add load units function
Browse files Browse the repository at this point in the history
  • Loading branch information
gxkl committed Sep 15, 2023
1 parent 7bd1891 commit c963a96
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions standalone/standalone/src/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class Runner {
LoadUnitLifecycleUtil.registerLifecycle(this.loadUnitMultiInstanceProtoHook);
}

async init() {
async load() {
StandaloneContextHandler.register();
LoadUnitFactory.registerLoadUnitCreator(StandaloneLoadUnitType, () => {
return new StandaloneLoadUnit(this.innerObjects);
Expand All @@ -146,8 +146,11 @@ export class Runner {
},
});
const loadUnits = await this.loadUnitLoader.load();
this.loadUnits = [ standaloneLoadUnit, ...loadUnits ];
return [ standaloneLoadUnit, ...loadUnits ];
}

async init() {
this.loadUnits = await this.load();
const instances: LoadUnitInstance[] = [];
for (const loadUnit of this.loadUnits) {
const instance = await LoadUnitInstanceFactory.createLoadUnitInstance(loadUnit);
Expand Down

0 comments on commit c963a96

Please sign in to comment.