@esportsplus/reactivity 0.12.1 → 0.12.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/build/system.js CHANGED
@@ -172,24 +172,25 @@ function schedule() {
172
172
  }
173
173
  }
174
174
  function stabilize() {
175
- root(() => {
176
- stabilizer = STABILIZER_RUNNING;
177
- for (index = 0; index <= length; index++) {
178
- let computed = heap[index];
179
- heap[index] = undefined;
180
- while (computed !== undefined) {
181
- let next = computed.nextHeap;
182
- recompute(computed, false);
183
- computed = next;
184
- }
185
- }
186
- if (stabilizer === STABILIZER_RESCHEDULE) {
187
- microtask(stabilize);
188
- }
189
- else {
190
- stabilizer = STABILIZER_IDLE;
175
+ let o = observer;
176
+ observer = null;
177
+ stabilizer = STABILIZER_RUNNING;
178
+ for (index = 0; index <= length; index++) {
179
+ let computed = heap[index];
180
+ heap[index] = undefined;
181
+ while (computed !== undefined) {
182
+ let next = computed.nextHeap;
183
+ recompute(computed, false);
184
+ computed = next;
191
185
  }
192
- });
186
+ }
187
+ observer = o;
188
+ if (stabilizer === STABILIZER_RESCHEDULE) {
189
+ microtask(stabilize);
190
+ }
191
+ else {
192
+ stabilizer = STABILIZER_IDLE;
193
+ }
193
194
  }
194
195
  function unlink(link) {
195
196
  let { dep, nextDep, nextSub, prevSub } = link;
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "private": false,
13
13
  "type": "module",
14
14
  "types": "build/index.d.ts",
15
- "version": "0.12.1",
15
+ "version": "0.12.2",
16
16
  "scripts": {
17
17
  "build": "tsc && tsc-alias",
18
18
  "-": "-"
package/src/system.ts CHANGED
@@ -253,30 +253,33 @@ function schedule() {
253
253
  }
254
254
 
255
255
  function stabilize() {
256
- root(() => {
257
- stabilizer = STABILIZER_RUNNING;
256
+ let o = observer;
258
257
 
259
- for (index = 0; index <= length; index++) {
260
- let computed = heap[index];
258
+ observer = null;
259
+ stabilizer = STABILIZER_RUNNING;
261
260
 
262
- heap[index] = undefined;
261
+ for (index = 0; index <= length; index++) {
262
+ let computed = heap[index];
263
263
 
264
- while (computed !== undefined) {
265
- let next = computed.nextHeap;
264
+ heap[index] = undefined;
266
265
 
267
- recompute(computed, false);
266
+ while (computed !== undefined) {
267
+ let next = computed.nextHeap;
268
268
 
269
- computed = next;
270
- }
271
- }
269
+ recompute(computed, false);
272
270
 
273
- if (stabilizer === STABILIZER_RESCHEDULE) {
274
- microtask(stabilize);
271
+ computed = next;
275
272
  }
276
- else {
277
- stabilizer = STABILIZER_IDLE;
278
- }
279
- });
273
+ }
274
+
275
+ observer = o;
276
+
277
+ if (stabilizer === STABILIZER_RESCHEDULE) {
278
+ microtask(stabilize);
279
+ }
280
+ else {
281
+ stabilizer = STABILIZER_IDLE;
282
+ }
280
283
  }
281
284
 
282
285
  // https://github.com/stackblitz/alien-signals/blob/v2.0.3/src/system.ts#L100