@restart/hooks
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -32,9 +32,13 @@ "use strict"; | ||
if (update === null) return; | ||
if (typeof update === 'function') setState(function (state) { | ||
var nextState = update(state); | ||
return nextState == null ? state : _extends({}, state, nextState); | ||
}); | ||
setState(function (state) { | ||
return _extends({}, state, update); | ||
}); | ||
if (typeof update === 'function') { | ||
setState(function (state) { | ||
var nextState = update(state); | ||
return nextState == null ? state : _extends({}, state, nextState); | ||
}); | ||
} else { | ||
setState(function (state) { | ||
return _extends({}, state, update); | ||
}); | ||
} | ||
}; | ||
@@ -41,0 +45,0 @@ |
{ | ||
"name": "@restart/hooks", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "types": "index.d.ts", |
@@ -32,9 +32,13 @@ "use strict"; | ||
if (update === null) return; | ||
if (typeof update === 'function') setState(function (state) { | ||
var nextState = update(state); | ||
return nextState == null ? state : _extends({}, state, nextState); | ||
}); | ||
setState(function (state) { | ||
return _extends({}, state, update); | ||
}); | ||
if (typeof update === 'function') { | ||
setState(function (state) { | ||
var nextState = update(state); | ||
return nextState == null ? state : _extends({}, state, nextState); | ||
}); | ||
} else { | ||
setState(function (state) { | ||
return _extends({}, state, update); | ||
}); | ||
} | ||
}; | ||
@@ -41,0 +45,0 @@ |
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
69923
1986