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

Function getCursorsStore

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

Source from the content-addressed store, hash-verified

9const CURSORS_TO_EDITABLE = new WeakMap<Editor, UseBoundStore<StoreApi<CursorStore>>>()
10
11export const getCursorsStore = (editor: Editor) => {
12 let store = CURSORS_TO_EDITABLE.get(editor)
13 if (!store) {
14 store = create(() => ({
15 clientIds: {
16 added: [],
17 removed: [],
18 updated: [],
19 },
20 states: {},
21 }))
22 CURSORS_TO_EDITABLE.set(editor, store)
23 }
24 return store
25}

Callers 2

awarenessChangeListenerFunction · 0.90
useCursorStoreFunction · 0.90

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…