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