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

Function getSlashToolbarStore

packages/plugins/toolbar/src/slash/store.ts:33–44  ·  view source on GitHub ↗
(editor: Editor)

Source from the content-addressed store, hash-verified

31const EDITOR_TO_TOOLBAR_STORE = new WeakMap<Editor, UseBoundStore<StoreApi<SlashToolbarState>>>()
32
33export const getSlashToolbarStore = (editor: Editor) => {
34 let store = EDITOR_TO_TOOLBAR_STORE.get(editor)
35 if (!store) {
36 store = create<SlashToolbarState>(() => ({
37 items: [],
38 open: false,
39 searchValue: '',
40 }))
41 EDITOR_TO_TOOLBAR_STORE.set(editor, store)
42 }
43 return store
44}
45
46export const SlashToolbar = {
47 setOpen(editor: Editor, open: boolean) {

Callers 4

useSlashToolbarStoreFunction · 0.90
setOpenFunction · 0.85
setItemsFunction · 0.85
setSearchValueFunction · 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…