Files
image-studio/view/useAppState.ts
2026-07-03 09:36:13 +02:00

8 lines
280 B
TypeScript

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);
}