Skip to content

Commit

Permalink
add writeHistory
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Apr 30, 2024
1 parent b48f1d6 commit bcc3fec
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-pugs-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-history': minor
---

Add `writeHistory`.
9 changes: 9 additions & 0 deletions packages/slate-history/src/history-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@ export const HistoryEditor = {
fn()
SAVING.set(editor, prev)
},


Check failure on line 89 in packages/slate-history/src/history-editor.ts

View workflow job for this annotation

GitHub Actions / lint:eslint

Delete `⏎`
/**
* Push a batch of operations as either undos or redos onto editor.undos or editor.redos
*/

writeHistory(editor: HistoryEditor, stack: 'undos' | 'redos', batch: any): void {

Check failure on line 94 in packages/slate-history/src/history-editor.ts

View workflow job for this annotation

GitHub Actions / lint:eslint

Replace `editor:·HistoryEditor,·stack:·'undos'·|·'redos',·batch:·any` with `⏎····editor:·HistoryEditor,⏎····stack:·'undos'·|·'redos',⏎····batch:·any⏎··`
return editor.writeHistory(stack, batch)
}

Check failure on line 96 in packages/slate-history/src/history-editor.ts

View workflow job for this annotation

GitHub Actions / lint:eslint

Insert `,`
}

0 comments on commit bcc3fec

Please sign in to comment.