treble-hook
Advanced tools
Comparing version 2.0.0-alpha.6 to 2.0.0-alpha.7
@@ -80,4 +80,10 @@ "use strict"; | ||
const [stateValue] = contextState; | ||
const isMounted = react_1.useRef(true); | ||
react_1.useEffect(() => { | ||
if (initWithSessionStorage) { | ||
return () => { | ||
isMounted.current = false; | ||
}; | ||
}, []); | ||
react_1.useEffect(() => { | ||
if (isMounted.current && initWithSessionStorage) { | ||
sessionStorage.setItem(topicName, JSON.stringify(stateValue)); | ||
@@ -84,0 +90,0 @@ } |
{ | ||
"name": "treble-hook", | ||
"version": "2.0.0-alpha.6", | ||
"version": "2.0.0-alpha.7", | ||
"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
12983
112