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

immer-reducer

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immer-reducer - npm Package Compare versions

Comparing version 0.7.8 to 0.7.9

4

package.json
{
"name": "immer-reducer",
"version": "0.7.8",
"version": "0.7.9",
"description": "",

@@ -42,4 +42,4 @@ "main": "lib/immer-reducer.js",

"dependencies": {
"immer": "^1.4.0 || ^2.0.0 || ^3.0.0 || ^4.0.0"
"immer": "^1.4.0 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
}
}

@@ -287,2 +287,25 @@ # immer-reducer

## 🃏 Tips and Tricks
You can replace the whole `draftState` with a new state if you'd like. This could be useful if you'd like to reset back to your initial state.
```ts
import {ImmerReducer} from "immer-reducer";
const initialState: State = {
user: {
firstName: "",
lastName: "",
},
};
class MyImmerReducer extends ImmerReducer<State> {
// omitting other reducer methods
reset() {
this.draftState = initialState;
}
}
```
## 📓 Helpers

@@ -289,0 +312,0 @@

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