Merge pull request #12 from sern-handler/jacoobes-patch-1

feat(ioc): order of init is determined
This commit is contained in:
Jacob Nguyen
2025-02-04 15:19:35 -06:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@sern/ioc",
"version": "1.1.0",
"version": "1.1.1",
"description": "Dependency Injection system",
"main": "dist/index.js",
"module": "./dist/index.js",

View File

@@ -73,7 +73,10 @@ export class Container {
const hookFunctions = this.hooks.get(name) || [];
for (const hookObject of hookFunctions) {
//@ts-ignore .registerHooks verifies the hookObject hasCallableMethod
hookObject[name](...args);
const result = hookObject[name](...args);
if(result instanceof Promise) {
await result;
}
}
}