@t8/react-store 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ function getStorage(session) {
|
|
|
10
10
|
}
|
|
11
11
|
function persist(store, storageKey, session = false) {
|
|
12
12
|
let inited = false;
|
|
13
|
-
function read() {
|
|
13
|
+
function read(state) {
|
|
14
14
|
let storage = getStorage(session);
|
|
15
15
|
if (storage) {
|
|
16
16
|
try {
|
|
@@ -19,7 +19,10 @@ function persist(store, storageKey, session = false) {
|
|
|
19
19
|
} catch {
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
if (!inited)
|
|
22
|
+
if (!inited) {
|
|
23
|
+
inited = true;
|
|
24
|
+
write(state);
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
function write(state) {
|
|
25
28
|
let storage = getStorage(session);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t8/react-store",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Small React app state management lib aligned with React's state pattern, condensed to the essentials",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
"typescript": "^5.9.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@t8/store": "^1.2.
|
|
48
|
+
"@t8/store": "^1.2.2"
|
|
49
49
|
}
|
|
50
50
|
}
|