MCPcopy Index your code
hub / github.com/editablejs/editable / getDragStore

Function getDragStore

packages/editor/src/plugin/drag.ts:29–38  ·  view source on GitHub ↗
(editor: Editor)

Source from the content-addressed store, hash-verified

27const EDITOR_TO_DRAG_STORE = new WeakMap<Editor, UseBoundStore<StoreApi<DragStore>>>()
28
29const getDragStore = (editor: Editor) => {
30 let store = EDITOR_TO_DRAG_STORE.get(editor)
31 if (!store) {
32 store = create<DragStore>(() => ({
33 drag: null,
34 }))
35 EDITOR_TO_DRAG_STORE.set(editor, store)
36 }
37 return store
38}
39
40/**
41 * 拖拽相关状态操作

Callers 1

drag.tsFile · 0.85

Calls 2

getMethod · 0.80
createFunction · 0.50

Tested by

no test coverage detected