mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
19 lines
478 B
TypeScript
19 lines
478 B
TypeScript
import type { Initializable } from './Initializable';
|
|
import { Initializer } from './Initializer';
|
|
|
|
/**
|
|
* Allows using an Initializable as an Initializer Handler.
|
|
*/
|
|
export class InitializableHandler extends Initializer {
|
|
protected readonly initializable: Initializable;
|
|
|
|
public constructor(initializable: Initializable) {
|
|
super();
|
|
this.initializable = initializable;
|
|
}
|
|
|
|
public async handle(): Promise<void> {
|
|
return this.initializable.initialize();
|
|
}
|
|
}
|