Files
AFFiNE-Mirror/packages/common/infra/src/index.ts
T
EYHN ad9b0303c4 refactor(core): refactor atom to use di (#5831)
To support multiple instances, this PR removes some atoms and implements them using the new DI system.

removed atom

- `pageSettingsAtom`
- `currentPageIdAtom`
- `currentModeAtom`
2024-02-27 03:50:53 +00:00

33 lines
1022 B
TypeScript

export * from './app-config-storage';
export * from './atom';
export * from './blocksuite';
export * from './command';
export * from './di';
export * from './initialization';
export * from './livedata';
export * from './page';
export * from './storage';
export * from './utils';
export * from './workspace';
import type { ServiceCollection } from './di';
import { CleanupService } from './lifecycle';
import { configurePageServices } from './page';
import { GlobalCache, GlobalState, MemoryMemento } from './storage';
import {
configureTestingWorkspaceServices,
configureWorkspaceServices,
} from './workspace';
export function configureInfraServices(services: ServiceCollection) {
services.add(CleanupService);
configureWorkspaceServices(services);
configurePageServices(services);
}
export function configureTestingInfraServices(services: ServiceCollection) {
configureTestingWorkspaceServices(services);
services.override(GlobalCache, MemoryMemento);
services.override(GlobalState, MemoryMemento);
}