feat(view): add read-only app state hook

This commit is contained in:
syntaxbullet
2026-07-03 09:36:13 +02:00
parent 9422494458
commit 51027ce535

7
view/useAppState.ts Normal file
View File

@@ -0,0 +1,7 @@
import { useSyncExternalStore } from "react";
import type { AppStore } from "@editor/store";
import type { AppState } from "@editor/state";
export function useAppState(store: AppStore): AppState {
return useSyncExternalStore(store.subscribe, store.getState, store.getState);
}