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

Function createHistoryProtocol

packages/protocols/src/history.ts:31–50  ·  view source on GitHub ↗
(editor: Editor)

Source from the content-addressed store, hash-verified

29}
30
31export const createHistoryProtocol = (editor: Editor): HistoryProtocol => {
32 const historyProtocol: HistoryProtocol = {
33 undo: () => {
34 console.warn('undo not implemented')
35 },
36 redo: () => {
37 console.warn('redo not implemented')
38 },
39 canUndo: () => {
40 return false
41 },
42 canRedo: () => {
43 return false
44 },
45 capture: (op: Operation) => {
46 return true
47 },
48 }
49 return historyProtocol
50}
51
52export const withHistoryProtocol = (editor: Editor): HistoryProtocol => {
53 let historyProtocol = HISTORY_PROTOCOL_WEAK_MAP.get(editor)

Callers 1

withHistoryProtocolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…