(editor: Editable)
| 54 | } |
| 55 | |
| 56 | export const useContextMenuOpen = (editor: Editable): [boolean, (open: boolean) => void] => { |
| 57 | const store = useContextMenuStore(editor) |
| 58 | const open = useStore(store, state => state.open) |
| 59 | return React.useMemo(() => { |
| 60 | return [ |
| 61 | open, |
| 62 | (open: boolean) => { |
| 63 | ContextMenu.setOpen(editor, open) |
| 64 | }, |
| 65 | ] |
| 66 | }, [editor, open]) |
| 67 | } |
| 68 | |
| 69 | type ContextMenuStoreAction = () => (() => void) | void |
| 70 |
no test coverage detected
searching dependent graphs…