treble-hook
Advanced tools
Comparing version
@@ -21,3 +21,8 @@ "use strict"; | ||
if (checkValue !== null) { | ||
normDefaultValue = checkValue; | ||
try { | ||
normDefaultValue = JSON.parse(checkValue); | ||
} | ||
catch (_) { | ||
normDefaultValue = checkValue; | ||
} | ||
} | ||
@@ -78,3 +83,3 @@ } | ||
if (initWithSessionStorage) { | ||
sessionStorage.setItem(topicName, String(stateValue)); | ||
sessionStorage.setItem(topicName, JSON.stringify(stateValue)); | ||
} | ||
@@ -81,0 +86,0 @@ }, [stateValue]); |
{ | ||
"name": "treble-hook", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "Get hooked on simple subscribe-and-publish in ReactJS.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
12585
2.52%106
4.95%