thunderous 2.3.6 → 2.3.7

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 CHANGED
@@ -50,8 +50,6 @@ var DEFAULT_RENDER_OPTIONS = {
50
50
 
51
51
  // src/signals.ts
52
52
  var subscriber = null;
53
- var updateQueue = /* @__PURE__ */ new Set();
54
- var isBatchingUpdates = false;
55
53
  var createSignal = (initVal, options) => {
56
54
  const subscribers = /* @__PURE__ */ new Set();
57
55
  let value = initVal;
@@ -82,36 +80,23 @@ var createSignal = (initVal, options) => {
82
80
  const oldValue = value;
83
81
  value = newValue;
84
82
  for (const fn of subscribers) {
85
- updateQueue.add(fn);
86
- }
87
- if (!isBatchingUpdates) {
88
- isBatchingUpdates = true;
89
- queueMicrotask(() => {
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
- }
99
- }
100
- }
101
- if (options?.debugMode === true || setterOptions?.debugMode === true) {
102
- let label = "anonymous signal";
103
- if (options?.label !== void 0) {
104
- label = `(${options.label})`;
105
- if (setterOptions?.label !== void 0) {
106
- label += ` ${setterOptions.label}`;
107
- }
108
- } else if (setterOptions?.label !== void 0) {
109
- label = setterOptions.label;
83
+ try {
84
+ fn();
85
+ } catch (error) {
86
+ console.error("Error in subscriber:", { error, oldValue, newValue, fn });
87
+ }
88
+ if (options?.debugMode === true || setterOptions?.debugMode === true) {
89
+ let label = "anonymous signal";
90
+ if (options?.label !== void 0) {
91
+ label = `(${options.label})`;
92
+ if (setterOptions?.label !== void 0) {
93
+ label += ` ${setterOptions.label}`;
110
94
  }
111
- console.log("Signal set:", { oldValue, newValue, subscribers, label });
95
+ } else if (setterOptions?.label !== void 0) {
96
+ label = setterOptions.label;
112
97
  }
113
- isBatchingUpdates = false;
114
- });
98
+ console.log("Signal set:", { oldValue, newValue, subscribers, label });
99
+ }
115
100
  }
116
101
  };
117
102
  return [getter, setter];
package/dist/index.js CHANGED
@@ -15,8 +15,6 @@ var DEFAULT_RENDER_OPTIONS = {
15
15
 
16
16
  // src/signals.ts
17
17
  var subscriber = null;
18
- var updateQueue = /* @__PURE__ */ new Set();
19
- var isBatchingUpdates = false;
20
18
  var createSignal = (initVal, options) => {
21
19
  const subscribers = /* @__PURE__ */ new Set();
22
20
  let value = initVal;
@@ -47,36 +45,23 @@ var createSignal = (initVal, options) => {
47
45
  const oldValue = value;
48
46
  value = newValue;
49
47
  for (const fn of subscribers) {
50
- updateQueue.add(fn);
51
- }
52
- if (!isBatchingUpdates) {
53
- isBatchingUpdates = true;
54
- queueMicrotask(() => {
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
- }
64
- }
65
- }
66
- if (options?.debugMode === true || setterOptions?.debugMode === true) {
67
- let label = "anonymous signal";
68
- if (options?.label !== void 0) {
69
- label = `(${options.label})`;
70
- if (setterOptions?.label !== void 0) {
71
- label += ` ${setterOptions.label}`;
72
- }
73
- } else if (setterOptions?.label !== void 0) {
74
- label = setterOptions.label;
48
+ try {
49
+ fn();
50
+ } catch (error) {
51
+ console.error("Error in subscriber:", { error, oldValue, newValue, fn });
52
+ }
53
+ if (options?.debugMode === true || setterOptions?.debugMode === true) {
54
+ let label = "anonymous signal";
55
+ if (options?.label !== void 0) {
56
+ label = `(${options.label})`;
57
+ if (setterOptions?.label !== void 0) {
58
+ label += ` ${setterOptions.label}`;
75
59
  }
76
- console.log("Signal set:", { oldValue, newValue, subscribers, label });
60
+ } else if (setterOptions?.label !== void 0) {
61
+ label = setterOptions.label;
77
62
  }
78
- isBatchingUpdates = false;
79
- });
63
+ console.log("Signal set:", { oldValue, newValue, subscribers, label });
64
+ }
80
65
  }
81
66
  };
82
67
  return [getter, setter];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",