mirror of
https://github.com/sern-handler/tools
synced 2026-06-06 01:16:59 +00:00
Merge pull request #12 from sern-handler/jacoobes-patch-1
feat(ioc): order of init is determined
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sern/ioc",
|
"name": "@sern/ioc",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "Dependency Injection system",
|
"description": "Dependency Injection system",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "./dist/index.js",
|
"module": "./dist/index.js",
|
||||||
|
|||||||
@@ -73,7 +73,10 @@ export class Container {
|
|||||||
const hookFunctions = this.hooks.get(name) || [];
|
const hookFunctions = this.hooks.get(name) || [];
|
||||||
for (const hookObject of hookFunctions) {
|
for (const hookObject of hookFunctions) {
|
||||||
//@ts-ignore .registerHooks verifies the hookObject hasCallableMethod
|
//@ts-ignore .registerHooks verifies the hookObject hasCallableMethod
|
||||||
hookObject[name](...args);
|
const result = hookObject[name](...args);
|
||||||
|
if(result instanceof Promise) {
|
||||||
|
await result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user