easy-react-state
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "easy-react-state", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Fun to use state management library for your awesome React app", | ||
@@ -5,0 +5,0 @@ "author": "ombori", |
@@ -184,3 +184,3 @@ # easy-react-state | ||
```tsx | ||
useSelector(selector: Selector): selectedState | ||
useSelector: Selector | ||
``` | ||
@@ -198,3 +198,4 @@ | ||
An object which holds functions which we can use to update the state. `easy-react-state` uses the amazing [immerjs](https://github.com/immerjs/immer). When updating a state, you can use mutator syntax like `state.name = 'zion'` for ease. Every setter must return the mutated state or new value. Internally, the state gets mutated inside the `setter` is a `draftState` created by immer. Then immer will create a new object based on the value, either `draftState` or new value, returned by `setter` leaving the `originalState` untouchable. | ||
An object which holds functions which we can use to update the state. `easy-react-state` uses the amazing [immerjs](https://github.com/immerjs/immer). When updating a state, you can use mutator syntax like `state.name = 'zion'` for ease. Every setter must return the mutated state or new value. Internally, the state gets mutated inside the `setter` is a `draftState` created by immer. Then immer will create a new object based on the value, either `draftState` or new value, returned by `setter` leaving the `originalState` untouchable. Note the setters which are returned by `createStateManger` are now `wrappedSetters`. If the passed `setters` are returning `state`. Then this `wrappedSetters` are | ||
now returning `void`. | ||
@@ -201,0 +202,0 @@ ## Cons |
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
245075
212