(editor: Editable)
| 33 | >() |
| 34 | |
| 35 | const getStore = (editor: Editable) => { |
| 36 | let store = EDITOR_TO_CONTEXT_MENU_STORE.get(editor) |
| 37 | if (!store) { |
| 38 | store = create<ContextMenuState>(() => ({ |
| 39 | items: [], |
| 40 | open: false, |
| 41 | })) |
| 42 | EDITOR_TO_CONTEXT_MENU_STORE.set(editor, store) |
| 43 | } |
| 44 | return store |
| 45 | } |
| 46 | |
| 47 | export const useContextMenuStore = (editor: Editable) => { |
| 48 | return React.useMemo(() => getStore(editor), [editor]) |
no test coverage detected
searching dependent graphs…