react-undoable
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "react-undoable", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Easily undo/redo any state in React, no external dependencies", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -145,3 +145,3 @@ # react-undoable 🔄 | ||
### `<Undoable />` | ||
## `<Undoable />` | ||
@@ -151,3 +151,3 @@ Initializes the main Undoable component that manages state. Renders a child function that passed | ||
#### Props | ||
### Props | ||
@@ -161,11 +161,11 @@ ```typescript | ||
#### Methods | ||
### Methods | ||
The Undoable component passes down the following methods in the child function. | ||
##### pushState(state: T): void | ||
#### pushState(state: T): void | ||
Pushes a new state to the stack. This tracks the change so it can be undone or redone. | ||
##### updateState(state: T): void | ||
#### updateState(state: T): void | ||
@@ -175,11 +175,11 @@ Update the state but **do not track the change**. This is useful for when you want to update the | ||
##### undo(): void | ||
#### undo(): void | ||
Undo the current state and replace with the previously tracked state. | ||
##### redo(): void | ||
#### redo(): void | ||
Redo a previous undone state. | ||
##### resetState(): void | ||
#### resetState(): void | ||
@@ -186,0 +186,0 @@ Reset the state stack so there are no undos/redos. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13059