feat(app): add composition root

This commit is contained in:
syntaxbullet
2026-07-03 09:36:04 +02:00
parent d7406e803a
commit 9422494458
6 changed files with 47 additions and 17 deletions

16
app/app.ts Normal file
View File

@@ -0,0 +1,16 @@
import { createCommandRegistry } from "@commands/registry";
import { viewportCommands } from "@commands/viewport";
import { createInitialAppState } from "@editor/initial-state";
import { createAppStore } from "@editor/store";
export type ImageStudioApp = ReturnType<typeof createImageStudioApp>;
export function createImageStudioApp(options?: { documentName?: string }) {
const registry = createCommandRegistry([...viewportCommands]);
const store = createAppStore(createInitialAppState(options?.documentName), registry);
return {
registry,
store,
};
}