MCPcopy Create free account
hub / github.com/editablejs/editable / getStore

Function getStore

packages/plugins/context-menu/src/store.ts:35–45  ·  view source on GitHub ↗
(editor: Editable)

Source from the content-addressed store, hash-verified

33>()
34
35const 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
47export const useContextMenuStore = (editor: Editable) => {
48 return React.useMemo(() => getStore(editor), [editor])

Callers 3

useContextMenuStoreFunction · 0.70
setOpenFunction · 0.70
setItemsFunction · 0.70

Calls 2

getMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…