diff --git a/src/Application.ts b/src/Application.ts index bfa586f..594dcda 100644 --- a/src/Application.ts +++ b/src/Application.ts @@ -207,7 +207,7 @@ export default abstract class Application { } } - async stop(): Promise { + public async stop(): Promise { Logger.info('Stopping application...'); for (const component of this.components) { @@ -254,4 +254,8 @@ export default abstract class Application { public getCache(): CacheProvider | undefined { return this.cacheProvider; } + + public getComponent>(type: Type): T | undefined { + return this.components.find(component => component.constructor === type); + } } \ No newline at end of file