mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 03:56:23 +08:00
feat(infra): standard lifecycle service (#5564)
This commit is contained in:
@@ -5,3 +5,17 @@ export * from './command';
|
||||
export * from './di';
|
||||
export * from './livedata';
|
||||
export * from './storage';
|
||||
|
||||
import type { ServiceCollection } from './di';
|
||||
import { CleanupService } from './lifecycle';
|
||||
import { GlobalCache, GlobalState, MemoryMemento } from './storage';
|
||||
|
||||
export function configureInfraServices(services: ServiceCollection) {
|
||||
services.add(CleanupService);
|
||||
}
|
||||
|
||||
export function configureTestingInfraServices(services: ServiceCollection) {
|
||||
configureInfraServices(services);
|
||||
services.addImpl(GlobalCache, MemoryMemento);
|
||||
services.addImpl(GlobalState, MemoryMemento);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user