mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-19 05:31:56 +02:00
A few improvements to HistoryEditor docs including fixing a link
This commit is contained in:
@@ -6,9 +6,9 @@ The `HistoryEditor` interface is added to the `Editor` when it is instantiated u
|
|||||||
const [editor] = useState(() => withReact(withHistory(createEditor())))
|
const [editor] = useState(() => withReact(withHistory(createEditor())))
|
||||||
```
|
```
|
||||||
|
|
||||||
This adds properties to `editor` that enables undo and redo to Slate.
|
This adds properties to `editor` that enables undo and redo in Slate.
|
||||||
|
|
||||||
There are also a number of static methods to help while working with the Editor's undo/redo history.
|
There are also static methods for working with the Editor's undo/redo history.
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
export interface HistoryEditor extends BaseEditor {
|
export interface HistoryEditor extends BaseEditor {
|
||||||
@@ -31,13 +31,13 @@ export interface HistoryEditor extends BaseEditor {
|
|||||||
|
|
||||||
#### `HistoryEditor.redo(editor: HistoryEditor): void`
|
#### `HistoryEditor.redo(editor: HistoryEditor): void`
|
||||||
|
|
||||||
Redo to the previous saved state.
|
Redo to the next saved state.
|
||||||
|
|
||||||
#### `HistoryEditor.undo(editor: HistoryEditor): void`
|
#### `HistoryEditor.undo(editor: HistoryEditor): void`
|
||||||
|
|
||||||
Undo to the previous saved state.
|
Undo to the previous saved state.
|
||||||
|
|
||||||
### Merging and Savings
|
### Merging and Saving
|
||||||
|
|
||||||
#### `HistoryEditor.withoutMerging(editor: HistoryEditor, fn: () => void): void`
|
#### `HistoryEditor.withoutMerging(editor: HistoryEditor, fn: () => void): void`
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user