thunderous 2.3.4 → 2.3.5
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.cjs +9 -6
- package/dist/index.js +9 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -87,11 +87,15 @@ var createSignal = (initVal, options) => {
|
|
87
87
|
if (!isBatchingUpdates) {
|
88
88
|
isBatchingUpdates = true;
|
89
89
|
queueMicrotask(() => {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
while (updateQueue.size > 0) {
|
91
|
+
const updates = Array.from(updateQueue);
|
92
|
+
updateQueue.clear();
|
93
|
+
for (const fn of updates) {
|
94
|
+
try {
|
95
|
+
fn();
|
96
|
+
} catch (error) {
|
97
|
+
console.error("Error in subscriber:", { error, oldValue, newValue, fn });
|
98
|
+
}
|
95
99
|
}
|
96
100
|
}
|
97
101
|
if (options?.debugMode === true || setterOptions?.debugMode === true) {
|
@@ -106,7 +110,6 @@ var createSignal = (initVal, options) => {
|
|
106
110
|
}
|
107
111
|
console.log("Signal set:", { oldValue, newValue, subscribers, label });
|
108
112
|
}
|
109
|
-
updateQueue.clear();
|
110
113
|
isBatchingUpdates = false;
|
111
114
|
});
|
112
115
|
}
|
package/dist/index.js
CHANGED
@@ -52,11 +52,15 @@ var createSignal = (initVal, options) => {
|
|
52
52
|
if (!isBatchingUpdates) {
|
53
53
|
isBatchingUpdates = true;
|
54
54
|
queueMicrotask(() => {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
55
|
+
while (updateQueue.size > 0) {
|
56
|
+
const updates = Array.from(updateQueue);
|
57
|
+
updateQueue.clear();
|
58
|
+
for (const fn of updates) {
|
59
|
+
try {
|
60
|
+
fn();
|
61
|
+
} catch (error) {
|
62
|
+
console.error("Error in subscriber:", { error, oldValue, newValue, fn });
|
63
|
+
}
|
60
64
|
}
|
61
65
|
}
|
62
66
|
if (options?.debugMode === true || setterOptions?.debugMode === true) {
|
@@ -71,7 +75,6 @@ var createSignal = (initVal, options) => {
|
|
71
75
|
}
|
72
76
|
console.log("Signal set:", { oldValue, newValue, subscribers, label });
|
73
77
|
}
|
74
|
-
updateQueue.clear();
|
75
78
|
isBatchingUpdates = false;
|
76
79
|
});
|
77
80
|
}
|