Loading...
A Hook for implementing canvas history tracking.
const { undo, redo, canUndo, canRedo } = useHistory();
const {undo: (options) => Graph | null,redo: (options) => Graph | null,canUndo: boolean,canRedo: boolean} = useHistory();
Parameter | Description | Type | Default Value |
---|---|---|---|
undo | Undo action; options will be passed to the event callback | (options?: KeyValue) => Graph | null | - |
redo | Redo action; options will be passed to the event callback | (options?: KeyValue) => Graph | null | - |
canUndo | Indicates if undo is possible | boolean | false |
canRedo | Indicates if redo is possible | boolean | false |
None