Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-undoable

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-undoable - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"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.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc