From c963a96096689aea679434b9ebd8db65c4d5f659 Mon Sep 17 00:00:00 2001 From: gxkl Date: Fri, 15 Sep 2023 10:06:20 +0800 Subject: [PATCH] feat: add load units function --- standalone/standalone/src/Runner.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/standalone/standalone/src/Runner.ts b/standalone/standalone/src/Runner.ts index a05969ea..1807b269 100644 --- a/standalone/standalone/src/Runner.ts +++ b/standalone/standalone/src/Runner.ts @@ -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); @@ -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);