cradova 3.11.9 → 3.11.10
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 +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -642,11 +642,11 @@ class Signal {
|
|
|
642
642
|
const key = localStorage.getItem(props.persistName);
|
|
643
643
|
if (key && key !== "undefined") {
|
|
644
644
|
const restored = JSON.parse(key);
|
|
645
|
-
if (!Array.isArray(restored)) {
|
|
646
|
-
this.store = new Store(restored, (key2) => {
|
|
645
|
+
if (typeof restored === "object" && !Array.isArray(restored)) {
|
|
646
|
+
this.store = new Store(Object.assign(initial, restored), (key2) => {
|
|
647
647
|
this.publish(key2);
|
|
648
648
|
});
|
|
649
|
-
} else {
|
|
649
|
+
} else if (Array.isArray(restored)) {
|
|
650
650
|
this.isList = true;
|
|
651
651
|
this.store = new List2(restored, (eventType) => {
|
|
652
652
|
this.publish(eventType);
|
|
@@ -658,14 +658,14 @@ class Signal {
|
|
|
658
658
|
publish(eventName) {
|
|
659
659
|
this.subscribers[eventName]?.forEach((c) => {
|
|
660
660
|
if (c.published) {
|
|
661
|
-
funcManager.recall(c
|
|
661
|
+
funcManager.recall(c);
|
|
662
662
|
} else {
|
|
663
663
|
c();
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
this.subscribers["__ALL__"]?.forEach((c) => {
|
|
667
667
|
if (c.published) {
|
|
668
|
-
funcManager.recall(c
|
|
668
|
+
funcManager.recall(c);
|
|
669
669
|
} else {
|
|
670
670
|
c();
|
|
671
671
|
}
|
|
@@ -692,7 +692,7 @@ class Signal {
|
|
|
692
692
|
}
|
|
693
693
|
for (const c of s.values()) {
|
|
694
694
|
if (c.published) {
|
|
695
|
-
funcManager.recall(c
|
|
695
|
+
funcManager.recall(c);
|
|
696
696
|
} else {
|
|
697
697
|
c();
|
|
698
698
|
}
|