react-stateful-function
Advanced tools
Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "react-stateful-function", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "React Statful Function", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
@@ -6,3 +6,3 @@ import { useReducer } from 'react'; | ||
const [state, dispatch] = useReducer(mini_reducer, initialState); | ||
const setState = (fState = {}) => { for (const type in fState) { dispatch({ type, payload: fState[type] }); } }; | ||
const setState = (fState = {}, callback = () => null) => { for (const type in fState) { dispatch({ type, payload: fState[type] }); } callback(); }; | ||
const resetState = () => setState(initialState); | ||
@@ -9,0 +9,0 @@ return { state, setState, resetState }; |
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
6931