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

Function getMentionStore

packages/plugins/mention/src/store.ts:11–21  ·  view source on GitHub ↗
(editor: Editor)

Source from the content-addressed store, hash-verified

9const EDITOR_TO_MENTION_STORE = new WeakMap<Editor, UseBoundStore<StoreApi<MentionStore>>>()
10
11export const getMentionStore = (editor: Editor) => {
12 let store = EDITOR_TO_MENTION_STORE.get(editor)
13 if (!store) {
14 store = create<MentionStore>(() => ({
15 open: false,
16 searchValue: '',
17 }))
18 EDITOR_TO_MENTION_STORE.set(editor, store)
19 }
20 return store
21}
22
23export const MentionStore = {
24 setSearchValue(editor: Editor, searchValue: string) {

Callers 3

useMentionStoreFunction · 0.90
setSearchValueFunction · 0.85
setOpenFunction · 0.85

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…