Files
webeditor3d/src/app/use-editor-store.ts

8 lines
275 B
TypeScript
Raw Normal View History

import { useSyncExternalStore } from "react";
import type { EditorStore, EditorStoreState } from "./editor-store";
export function useEditorStoreState(store: EditorStore): EditorStoreState {
return useSyncExternalStore(store.subscribe, store.getState, store.getState);
}