atomic-state
Advanced tools
Comparing version 1.3.5 to 1.3.6
@@ -81,6 +81,10 @@ "use strict"; | ||
var hookCall = (0, react_1.useMemo)(function () { return "".concat(Math.random()).split(".")[1]; }, []); | ||
var isNumber = typeof init.default === "number"; | ||
var isDefined = typeof init.default !== "undefined"; | ||
var initialValue = (function getInitialValue() { | ||
var isFunction = typeof init.default === "function"; | ||
var initVal = init.default || isNumber ? init.default : defaultAtomsValues[init.name]; | ||
var initVal = isDefined | ||
? typeof defaultAtomsValues[init.name] === "undefined" | ||
? init.default | ||
: defaultAtomsValues[init.name] | ||
: defaultAtomsValues[init.name]; | ||
try { | ||
@@ -175,2 +179,3 @@ return init.localStoragePersistence | ||
var newValue = typeof v === "function" ? v(previous) : v; | ||
defaultAtomsValues[init.name] = newValue; | ||
notify(init.name, hookCall, newValue); | ||
@@ -177,0 +182,0 @@ // Finally update state |
{ | ||
"name": "atomic-state", | ||
"version": "1.3.5", | ||
"description": "State managment library for React and React Native apps", | ||
"version": "1.3.6", | ||
"description": "State managment library for React", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
68152
474