diff --git a/src/core/ioc/container.ts b/src/core/ioc/container.ts index 6bf1c796..50526ad0 100644 --- a/src/core/ioc/container.ts +++ b/src/core/ioc/container.ts @@ -17,11 +17,12 @@ export class CoreContainer> extends Container) - .add({ '@sern/errors': () => new DefaultServices.DefaultErrorHandling(), + .add({ '@sern/errors': () => new DefaultServices.DefaultErrorHandling, '@sern/emitter': () => new SernEmitter, '@sern/store': () => new ModuleStore }) .add(ctx => { @@ -46,6 +47,9 @@ export class CoreContainer> extends Container(...keys: [...T] } /** - * Given the user's conf, check for any excluded dependency keys. + * Given the user's conf, check for any excluded/included dependency keys. * Then, call conf.build to get the rest of the users' dependencies. * Finally, update the containerSubject with the new container state * @param conf diff --git a/src/core/ioc/hooks.ts b/src/core/ioc/hooks.ts index a1db322e..0a325572 100644 --- a/src/core/ioc/hooks.ts +++ b/src/core/ioc/hooks.ts @@ -9,7 +9,7 @@ type HookName = 'init'; export const createInitListener = (coreContainer : CoreContainer) => { const initCalled = new Set(); const hasCallableMethod = createPredicate(initCalled); - const unsubscribe = coreContainer.on('containerUpserted', async (event) => { + const unsubscribe = coreContainer.on('containerUpserted', async event => { if(isNotHookable(event)) { return; @@ -21,6 +21,7 @@ export const createInitListener = (coreContainer : CoreContainer) => { } }); + return { unsubscribe }; }