Files
AFFiNE-Mirror/blocksuite/framework/std/src/extension/service-manager.ts
T
2025-03-28 07:20:34 +00:00

23 lines
546 B
TypeScript

import { LifeCycleWatcher } from '../extension/index.js';
import { BlockServiceIdentifier } from '../identifier.js';
export class ServiceManager extends LifeCycleWatcher {
static override readonly key = 'serviceManager';
override mounted() {
super.mounted();
this.std.provider.getAll(BlockServiceIdentifier).forEach(service => {
service.mounted();
});
}
override unmounted() {
super.unmounted();
this.std.provider.getAll(BlockServiceIdentifier).forEach(service => {
service.unmounted();
});
}
}