Lazy initialize sandboxes (workers) upon first need

This commit is contained in:
Zef Hemel
2022-11-01 09:57:20 +01:00
parent a5b8fce3eb
commit 5d9329a531
6 changed files with 40 additions and 18 deletions
+2 -2
View File
@@ -245,13 +245,13 @@ export class Editor {
).json();
this.system.on({
plugLoaded: async (plug) => {
sandboxInitialized: async (sandbox) => {
for (
const [modName, code] of Object.entries(
globalModules.dependencies,
)
) {
await plug.sandbox.loadDependency(modName, code as string);
await sandbox.loadDependency(modName, code as string);
}
},
});