Add Application.getComponent()
This commit is contained in:
parent
c1114c83b8
commit
75c2b72f57
@ -207,7 +207,7 @@ export default abstract class Application {
|
||||
}
|
||||
}
|
||||
|
||||
async stop(): Promise<void> {
|
||||
public async stop(): Promise<void> {
|
||||
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<T extends ApplicationComponent<any>>(type: Type<T>): T | undefined {
|
||||
return <T>this.components.find(component => component.constructor === type);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user