@solidjs/signals 0.0.6 → 0.0.8
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/dev.js +222 -82
- package/dist/node.cjs +501 -357
- package/dist/prod.js +494 -357
- package/dist/types/core/core.d.ts +13 -9
- package/dist/types/core/effect.d.ts +7 -4
- package/dist/types/core/error.d.ts +3 -0
- package/dist/types/core/index.d.ts +2 -2
- package/dist/types/core/scheduler.d.ts +2 -3
- package/dist/types/core/suspense.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/map.d.ts +9 -1
- package/dist/types/signals.d.ts +24 -3
- package/dist/types/store/index.d.ts +2 -1
- package/dist/types/store/projection.d.ts +6 -0
- package/dist/types/store/store.d.ts +0 -6
- package/package.json +1 -1
package/dist/node.cjs
CHANGED
|
@@ -15,6 +15,12 @@ var ContextNotFoundError = class extends Error {
|
|
|
15
15
|
);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
+
var EffectError = class extends Error {
|
|
19
|
+
constructor(effect, cause) {
|
|
20
|
+
super("");
|
|
21
|
+
this.cause = cause;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
18
24
|
|
|
19
25
|
// src/core/constants.ts
|
|
20
26
|
var STATE_CLEAN = 0;
|
|
@@ -101,82 +107,82 @@ var Owner = class {
|
|
|
101
107
|
// We flatten the owner tree into a linked list so that we don't need a pointer to .firstChild
|
|
102
108
|
// However, the children are actually added in reverse creation order
|
|
103
109
|
// See comment at the top of the file for an example of the _nextSibling traversal
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
110
|
+
r = null;
|
|
111
|
+
n = null;
|
|
112
|
+
s = null;
|
|
107
113
|
a = STATE_CLEAN;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
l = null;
|
|
115
|
+
p = defaultContext;
|
|
116
|
+
m = null;
|
|
117
|
+
g = null;
|
|
112
118
|
constructor(signal = false) {
|
|
113
119
|
if (currentOwner && !signal)
|
|
114
120
|
currentOwner.append(this);
|
|
115
121
|
}
|
|
116
122
|
append(child) {
|
|
117
|
-
child.
|
|
118
|
-
child.
|
|
119
|
-
if (this.
|
|
120
|
-
this.
|
|
121
|
-
child.
|
|
122
|
-
this.
|
|
123
|
-
if (child.
|
|
124
|
-
child.
|
|
123
|
+
child.r = this;
|
|
124
|
+
child.s = this;
|
|
125
|
+
if (this.n)
|
|
126
|
+
this.n.s = child;
|
|
127
|
+
child.n = this.n;
|
|
128
|
+
this.n = child;
|
|
129
|
+
if (child.p !== this.p) {
|
|
130
|
+
child.p = { ...this.p, ...child.p };
|
|
125
131
|
}
|
|
126
|
-
if (this.
|
|
127
|
-
child.
|
|
132
|
+
if (this.m) {
|
|
133
|
+
child.m = !child.m ? this.m : [...child.m, ...this.m];
|
|
128
134
|
}
|
|
129
|
-
if (this.
|
|
130
|
-
child.
|
|
135
|
+
if (this.g)
|
|
136
|
+
child.g = this.g;
|
|
131
137
|
}
|
|
132
138
|
dispose(self = true) {
|
|
133
139
|
if (this.a === STATE_DISPOSED)
|
|
134
140
|
return;
|
|
135
|
-
let head = self ? this.
|
|
136
|
-
while (current && current.
|
|
141
|
+
let head = self ? this.s || this.r : this, current = this.n, next = null;
|
|
142
|
+
while (current && current.r === this) {
|
|
137
143
|
current.dispose(true);
|
|
138
|
-
current.
|
|
139
|
-
next = current.
|
|
140
|
-
current.
|
|
144
|
+
current.y();
|
|
145
|
+
next = current.n;
|
|
146
|
+
current.n = null;
|
|
141
147
|
current = next;
|
|
142
148
|
}
|
|
143
149
|
if (self)
|
|
144
|
-
this.
|
|
150
|
+
this.y();
|
|
145
151
|
if (current)
|
|
146
|
-
current.
|
|
152
|
+
current.s = !self ? this : this.s;
|
|
147
153
|
if (head)
|
|
148
|
-
head.
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
if (this.
|
|
152
|
-
this.
|
|
153
|
-
this.
|
|
154
|
-
this.
|
|
155
|
-
this.
|
|
156
|
-
this.
|
|
154
|
+
head.n = current;
|
|
155
|
+
}
|
|
156
|
+
y() {
|
|
157
|
+
if (this.s)
|
|
158
|
+
this.s.n = null;
|
|
159
|
+
this.r = null;
|
|
160
|
+
this.s = null;
|
|
161
|
+
this.p = defaultContext;
|
|
162
|
+
this.m = null;
|
|
157
163
|
this.a = STATE_DISPOSED;
|
|
158
164
|
this.emptyDisposal();
|
|
159
165
|
}
|
|
160
166
|
emptyDisposal() {
|
|
161
|
-
if (!this.
|
|
167
|
+
if (!this.l)
|
|
162
168
|
return;
|
|
163
|
-
if (Array.isArray(this.
|
|
164
|
-
for (let i = 0; i < this.
|
|
165
|
-
const callable = this.
|
|
169
|
+
if (Array.isArray(this.l)) {
|
|
170
|
+
for (let i = 0; i < this.l.length; i++) {
|
|
171
|
+
const callable = this.l[i];
|
|
166
172
|
callable.call(callable);
|
|
167
173
|
}
|
|
168
174
|
} else {
|
|
169
|
-
this.
|
|
175
|
+
this.l.call(this.l);
|
|
170
176
|
}
|
|
171
|
-
this.
|
|
177
|
+
this.l = null;
|
|
172
178
|
}
|
|
173
179
|
handleError(error) {
|
|
174
|
-
if (!this.
|
|
180
|
+
if (!this.m)
|
|
175
181
|
throw error;
|
|
176
|
-
let i = 0, len = this.
|
|
182
|
+
let i = 0, len = this.m.length;
|
|
177
183
|
for (i = 0; i < len; i++) {
|
|
178
184
|
try {
|
|
179
|
-
this.
|
|
185
|
+
this.m[i](error);
|
|
180
186
|
break;
|
|
181
187
|
} catch (e) {
|
|
182
188
|
error = e;
|
|
@@ -193,7 +199,7 @@ function getContext(context, owner = currentOwner) {
|
|
|
193
199
|
if (!owner) {
|
|
194
200
|
throw new NoOwnerError();
|
|
195
201
|
}
|
|
196
|
-
const value = hasContext(context, owner) ? owner.
|
|
202
|
+
const value = hasContext(context, owner) ? owner.p[context.id] : context.defaultValue;
|
|
197
203
|
if (isUndefined(value)) {
|
|
198
204
|
throw new ContextNotFoundError();
|
|
199
205
|
}
|
|
@@ -203,24 +209,24 @@ function setContext(context, value, owner = currentOwner) {
|
|
|
203
209
|
if (!owner) {
|
|
204
210
|
throw new NoOwnerError();
|
|
205
211
|
}
|
|
206
|
-
owner.
|
|
207
|
-
...owner.
|
|
212
|
+
owner.p = {
|
|
213
|
+
...owner.p,
|
|
208
214
|
[context.id]: isUndefined(value) ? context.defaultValue : value
|
|
209
215
|
};
|
|
210
216
|
}
|
|
211
217
|
function hasContext(context, owner = currentOwner) {
|
|
212
|
-
return !isUndefined(owner == null ? void 0 : owner.
|
|
218
|
+
return !isUndefined(owner == null ? void 0 : owner.p[context.id]);
|
|
213
219
|
}
|
|
214
220
|
function onCleanup(fn) {
|
|
215
221
|
if (!currentOwner)
|
|
216
222
|
return fn;
|
|
217
223
|
const node = currentOwner;
|
|
218
|
-
if (!node.
|
|
219
|
-
node.
|
|
220
|
-
} else if (Array.isArray(node.
|
|
221
|
-
node.
|
|
224
|
+
if (!node.l) {
|
|
225
|
+
node.l = fn;
|
|
226
|
+
} else if (Array.isArray(node.l)) {
|
|
227
|
+
node.l.push(fn);
|
|
222
228
|
} else {
|
|
223
|
-
node.
|
|
229
|
+
node.l = [node.l, fn];
|
|
224
230
|
}
|
|
225
231
|
return fn;
|
|
226
232
|
}
|
|
@@ -244,49 +250,52 @@ var updateCheck = null;
|
|
|
244
250
|
function getObserver() {
|
|
245
251
|
return currentObserver;
|
|
246
252
|
}
|
|
253
|
+
function getClock() {
|
|
254
|
+
return clock;
|
|
255
|
+
}
|
|
247
256
|
function incrementClock() {
|
|
248
257
|
clock++;
|
|
249
258
|
}
|
|
250
259
|
var UNCHANGED = Symbol(0);
|
|
251
260
|
var Computation = class extends Owner {
|
|
252
|
-
|
|
261
|
+
d = null;
|
|
253
262
|
b = null;
|
|
254
|
-
|
|
255
|
-
|
|
263
|
+
e;
|
|
264
|
+
w;
|
|
256
265
|
// Used in __DEV__ mode, hopefully removed in production
|
|
257
|
-
|
|
266
|
+
Y;
|
|
258
267
|
// Using false is an optimization as an alternative to _equals: () => false
|
|
259
268
|
// which could enable more efficient DIRTY notification
|
|
260
|
-
|
|
261
|
-
|
|
269
|
+
L = isEqual;
|
|
270
|
+
S;
|
|
262
271
|
/** Whether the computation is an error or has ancestors that are unresolved */
|
|
263
|
-
|
|
272
|
+
h = 0;
|
|
264
273
|
/** Which flags raised by sources are handled, vs. being passed through. */
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
274
|
+
M = DEFAULT_FLAGS;
|
|
275
|
+
N = null;
|
|
276
|
+
z = -1;
|
|
277
|
+
H = false;
|
|
269
278
|
constructor(initialValue, compute2, options) {
|
|
270
279
|
super(compute2 === null);
|
|
271
|
-
this.
|
|
280
|
+
this.w = compute2;
|
|
272
281
|
this.a = compute2 ? STATE_UNINITIALIZED : STATE_CLEAN;
|
|
273
|
-
this.
|
|
282
|
+
this.e = initialValue;
|
|
274
283
|
if ((options == null ? void 0 : options.equals) !== void 0)
|
|
275
|
-
this.
|
|
284
|
+
this.L = options.equals;
|
|
276
285
|
if (options == null ? void 0 : options.unobserved)
|
|
277
|
-
this.
|
|
286
|
+
this.S = options == null ? void 0 : options.unobserved;
|
|
278
287
|
}
|
|
279
|
-
|
|
288
|
+
T() {
|
|
280
289
|
var _a;
|
|
281
|
-
if (this.
|
|
282
|
-
this.
|
|
283
|
-
if (!this.
|
|
290
|
+
if (this.w)
|
|
291
|
+
this.x();
|
|
292
|
+
if (!this.w || ((_a = this.d) == null ? void 0 : _a.length))
|
|
284
293
|
track(this);
|
|
285
|
-
newFlags |= this.
|
|
286
|
-
if (this.
|
|
287
|
-
throw this.
|
|
294
|
+
newFlags |= this.h & ~currentMask;
|
|
295
|
+
if (this.h & ERROR_BIT) {
|
|
296
|
+
throw this.e;
|
|
288
297
|
} else {
|
|
289
|
-
return this.
|
|
298
|
+
return this.e;
|
|
290
299
|
}
|
|
291
300
|
}
|
|
292
301
|
/**
|
|
@@ -294,7 +303,7 @@ var Computation = class extends Owner {
|
|
|
294
303
|
* Automatically re-executes the surrounding computation when the value changes
|
|
295
304
|
*/
|
|
296
305
|
read() {
|
|
297
|
-
return this.
|
|
306
|
+
return this.T();
|
|
298
307
|
}
|
|
299
308
|
/**
|
|
300
309
|
* Return the current value of this computation
|
|
@@ -304,10 +313,13 @@ var Computation = class extends Owner {
|
|
|
304
313
|
* before continuing
|
|
305
314
|
*/
|
|
306
315
|
wait() {
|
|
316
|
+
if (this.w && this.h & ERROR_BIT && this.z <= clock) {
|
|
317
|
+
update(this);
|
|
318
|
+
}
|
|
307
319
|
if (!syncResolve && this.loading()) {
|
|
308
320
|
throw new NotReadyError();
|
|
309
321
|
}
|
|
310
|
-
return this.
|
|
322
|
+
return this.T();
|
|
311
323
|
}
|
|
312
324
|
/**
|
|
313
325
|
* Return true if the computation is the value is dependent on an unresolved promise
|
|
@@ -317,51 +329,42 @@ var Computation = class extends Owner {
|
|
|
317
329
|
* loading state changes
|
|
318
330
|
*/
|
|
319
331
|
loading() {
|
|
320
|
-
if (this.
|
|
321
|
-
this.
|
|
332
|
+
if (this.N === null) {
|
|
333
|
+
this.N = loadingState(this);
|
|
322
334
|
}
|
|
323
|
-
return this.
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Return true if the computation is the computation threw an error
|
|
327
|
-
* Triggers re-execution of the computation when the error state changes
|
|
328
|
-
*/
|
|
329
|
-
error() {
|
|
330
|
-
if (this.z === null) {
|
|
331
|
-
this.z = errorState(this);
|
|
332
|
-
}
|
|
333
|
-
return this.z.read();
|
|
335
|
+
return this.N.read();
|
|
334
336
|
}
|
|
335
337
|
/** Update the computation with a new value. */
|
|
336
338
|
write(value, flags = 0, raw = false) {
|
|
337
|
-
const newValue = !raw && typeof value === "function" ? value(this.
|
|
338
|
-
const valueChanged = newValue !== UNCHANGED && (!!(flags & ERROR_BIT) || this.a === STATE_UNINITIALIZED || this.
|
|
339
|
+
const newValue = !raw && typeof value === "function" ? value(this.e) : value;
|
|
340
|
+
const valueChanged = newValue !== UNCHANGED && (!!(flags & ERROR_BIT) || this.a === STATE_UNINITIALIZED || this.L === false || !this.L(this.e, newValue));
|
|
339
341
|
if (valueChanged)
|
|
340
|
-
this.
|
|
341
|
-
const changedFlagsMask = this.
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
342
|
+
this.e = newValue;
|
|
343
|
+
const changedFlagsMask = this.h ^ flags, changedFlags = changedFlagsMask & flags;
|
|
344
|
+
this.h = flags;
|
|
345
|
+
this.z = clock + 1;
|
|
344
346
|
if (this.b) {
|
|
345
347
|
for (let i = 0; i < this.b.length; i++) {
|
|
346
348
|
if (valueChanged) {
|
|
347
|
-
this.b[i].
|
|
349
|
+
this.b[i].q(STATE_DIRTY);
|
|
348
350
|
} else if (changedFlagsMask) {
|
|
349
|
-
this.b[i].
|
|
351
|
+
this.b[i].U(changedFlagsMask, changedFlags);
|
|
350
352
|
}
|
|
351
353
|
}
|
|
352
354
|
}
|
|
353
|
-
return this.
|
|
355
|
+
return this.e;
|
|
354
356
|
}
|
|
355
357
|
/**
|
|
356
358
|
* Set the current node's state, and recursively mark all of this node's observers as STATE_CHECK
|
|
357
359
|
*/
|
|
358
|
-
|
|
359
|
-
if (this.a >= state)
|
|
360
|
+
q(state, skipQueue) {
|
|
361
|
+
if (this.a >= state && !this.H)
|
|
360
362
|
return;
|
|
363
|
+
this.H = !!skipQueue;
|
|
361
364
|
this.a = state;
|
|
362
365
|
if (this.b) {
|
|
363
366
|
for (let i = 0; i < this.b.length; i++) {
|
|
364
|
-
this.b[i].
|
|
367
|
+
this.b[i].q(STATE_CHECK, skipQueue);
|
|
365
368
|
}
|
|
366
369
|
}
|
|
367
370
|
}
|
|
@@ -371,30 +374,30 @@ var Computation = class extends Owner {
|
|
|
371
374
|
* @param mask A bitmask for which flag(s) were changed.
|
|
372
375
|
* @param newFlags The source's new flags, masked to just the changed ones.
|
|
373
376
|
*/
|
|
374
|
-
|
|
377
|
+
U(mask, newFlags2) {
|
|
375
378
|
if (this.a >= STATE_DIRTY)
|
|
376
379
|
return;
|
|
377
|
-
if (mask & this.
|
|
378
|
-
this.
|
|
380
|
+
if (mask & this.M) {
|
|
381
|
+
this.q(STATE_DIRTY);
|
|
379
382
|
return;
|
|
380
383
|
}
|
|
381
384
|
if (this.a >= STATE_CHECK)
|
|
382
385
|
return;
|
|
383
|
-
const prevFlags = this.
|
|
386
|
+
const prevFlags = this.h & mask;
|
|
384
387
|
const deltaFlags = prevFlags ^ newFlags2;
|
|
385
388
|
if (newFlags2 === prevFlags) ; else if (deltaFlags & prevFlags & mask) {
|
|
386
|
-
this.
|
|
389
|
+
this.q(STATE_CHECK);
|
|
387
390
|
} else {
|
|
388
|
-
this.
|
|
391
|
+
this.h ^= deltaFlags;
|
|
389
392
|
if (this.b) {
|
|
390
393
|
for (let i = 0; i < this.b.length; i++) {
|
|
391
|
-
this.b[i].
|
|
394
|
+
this.b[i].U(mask, newFlags2);
|
|
392
395
|
}
|
|
393
396
|
}
|
|
394
397
|
}
|
|
395
398
|
}
|
|
396
|
-
|
|
397
|
-
this.write(error, this.
|
|
399
|
+
O(error) {
|
|
400
|
+
this.write(error, this.h & ~LOADING_BIT | ERROR_BIT);
|
|
398
401
|
}
|
|
399
402
|
/**
|
|
400
403
|
* This is the core part of the reactivity system, which makes sure that the values are updated
|
|
@@ -403,7 +406,7 @@ var Computation = class extends Owner {
|
|
|
403
406
|
*
|
|
404
407
|
* This function will ensure that the value and states we read from the computation are up to date
|
|
405
408
|
*/
|
|
406
|
-
|
|
409
|
+
x() {
|
|
407
410
|
if (this.a === STATE_DISPOSED) {
|
|
408
411
|
throw new Error("Tried to read a disposed computation");
|
|
409
412
|
}
|
|
@@ -412,9 +415,9 @@ var Computation = class extends Owner {
|
|
|
412
415
|
}
|
|
413
416
|
let observerFlags = 0;
|
|
414
417
|
if (this.a === STATE_CHECK) {
|
|
415
|
-
for (let i = 0; i < this.
|
|
416
|
-
this.
|
|
417
|
-
observerFlags |= this.
|
|
418
|
+
for (let i = 0; i < this.d.length; i++) {
|
|
419
|
+
this.d[i].x();
|
|
420
|
+
observerFlags |= this.d[i].h;
|
|
418
421
|
if (this.a === STATE_DIRTY) {
|
|
419
422
|
break;
|
|
420
423
|
}
|
|
@@ -430,49 +433,33 @@ var Computation = class extends Owner {
|
|
|
430
433
|
/**
|
|
431
434
|
* Remove ourselves from the owner graph and the computation graph
|
|
432
435
|
*/
|
|
433
|
-
|
|
436
|
+
y() {
|
|
434
437
|
if (this.a === STATE_DISPOSED)
|
|
435
438
|
return;
|
|
436
|
-
if (this.
|
|
439
|
+
if (this.d)
|
|
437
440
|
removeSourceObservers(this, 0);
|
|
438
|
-
super.
|
|
441
|
+
super.y();
|
|
439
442
|
}
|
|
440
443
|
};
|
|
441
444
|
function loadingState(node) {
|
|
442
|
-
const prevOwner = setOwner(node.
|
|
443
|
-
const options = void 0;
|
|
444
|
-
const computation = new Computation(
|
|
445
|
-
void 0,
|
|
446
|
-
() => {
|
|
447
|
-
track(node);
|
|
448
|
-
node.s();
|
|
449
|
-
return !!(node.f & LOADING_BIT);
|
|
450
|
-
},
|
|
451
|
-
options
|
|
452
|
-
);
|
|
453
|
-
computation.D = ERROR_BIT | LOADING_BIT;
|
|
454
|
-
setOwner(prevOwner);
|
|
455
|
-
return computation;
|
|
456
|
-
}
|
|
457
|
-
function errorState(node) {
|
|
458
|
-
const prevOwner = setOwner(node.o);
|
|
445
|
+
const prevOwner = setOwner(node.r);
|
|
459
446
|
const options = void 0;
|
|
460
447
|
const computation = new Computation(
|
|
461
448
|
void 0,
|
|
462
449
|
() => {
|
|
463
450
|
track(node);
|
|
464
|
-
node.
|
|
465
|
-
return !!(node.
|
|
451
|
+
node.x();
|
|
452
|
+
return !!(node.h & LOADING_BIT);
|
|
466
453
|
},
|
|
467
454
|
options
|
|
468
455
|
);
|
|
469
|
-
computation.
|
|
456
|
+
computation.M = ERROR_BIT | LOADING_BIT;
|
|
470
457
|
setOwner(prevOwner);
|
|
471
458
|
return computation;
|
|
472
459
|
}
|
|
473
460
|
function track(computation) {
|
|
474
461
|
if (currentObserver) {
|
|
475
|
-
if (!newSources && currentObserver.
|
|
462
|
+
if (!newSources && currentObserver.d && currentObserver.d[newSourcesIndex] === computation) {
|
|
476
463
|
newSourcesIndex++;
|
|
477
464
|
} else if (!newSources)
|
|
478
465
|
newSources = [computation];
|
|
@@ -480,7 +467,7 @@ function track(computation) {
|
|
|
480
467
|
newSources.push(computation);
|
|
481
468
|
}
|
|
482
469
|
if (updateCheck) {
|
|
483
|
-
updateCheck.
|
|
470
|
+
updateCheck.e = computation.z > currentObserver.z;
|
|
484
471
|
}
|
|
485
472
|
}
|
|
486
473
|
}
|
|
@@ -492,41 +479,42 @@ function update(node) {
|
|
|
492
479
|
try {
|
|
493
480
|
node.dispose(false);
|
|
494
481
|
node.emptyDisposal();
|
|
495
|
-
const result = compute(node, node.
|
|
482
|
+
const result = compute(node, node.w, node);
|
|
496
483
|
node.write(result, newFlags, true);
|
|
497
484
|
} catch (error) {
|
|
498
485
|
if (error instanceof NotReadyError) {
|
|
499
486
|
node.write(UNCHANGED, newFlags | LOADING_BIT);
|
|
500
487
|
} else {
|
|
501
|
-
node.
|
|
488
|
+
node.O(error);
|
|
502
489
|
}
|
|
503
490
|
} finally {
|
|
504
491
|
if (newSources) {
|
|
505
|
-
if (node.
|
|
492
|
+
if (node.d)
|
|
506
493
|
removeSourceObservers(node, newSourcesIndex);
|
|
507
|
-
if (node.
|
|
508
|
-
node.
|
|
494
|
+
if (node.d && newSourcesIndex > 0) {
|
|
495
|
+
node.d.length = newSourcesIndex + newSources.length;
|
|
509
496
|
for (let i = 0; i < newSources.length; i++) {
|
|
510
|
-
node.
|
|
497
|
+
node.d[newSourcesIndex + i] = newSources[i];
|
|
511
498
|
}
|
|
512
499
|
} else {
|
|
513
|
-
node.
|
|
500
|
+
node.d = newSources;
|
|
514
501
|
}
|
|
515
502
|
let source;
|
|
516
|
-
for (let i = newSourcesIndex; i < node.
|
|
517
|
-
source = node.
|
|
503
|
+
for (let i = newSourcesIndex; i < node.d.length; i++) {
|
|
504
|
+
source = node.d[i];
|
|
518
505
|
if (!source.b)
|
|
519
506
|
source.b = [node];
|
|
520
507
|
else
|
|
521
508
|
source.b.push(node);
|
|
522
509
|
}
|
|
523
|
-
} else if (node.
|
|
510
|
+
} else if (node.d && newSourcesIndex < node.d.length) {
|
|
524
511
|
removeSourceObservers(node, newSourcesIndex);
|
|
525
|
-
node.
|
|
512
|
+
node.d.length = newSourcesIndex;
|
|
526
513
|
}
|
|
527
514
|
newSources = prevSources;
|
|
528
515
|
newSourcesIndex = prevSourcesIndex;
|
|
529
516
|
newFlags = prevFlags;
|
|
517
|
+
node.z = clock + 1;
|
|
530
518
|
node.a = STATE_CLEAN;
|
|
531
519
|
}
|
|
532
520
|
}
|
|
@@ -534,14 +522,14 @@ function removeSourceObservers(node, index) {
|
|
|
534
522
|
var _a;
|
|
535
523
|
let source;
|
|
536
524
|
let swap;
|
|
537
|
-
for (let i = index; i < node.
|
|
538
|
-
source = node.
|
|
525
|
+
for (let i = index; i < node.d.length; i++) {
|
|
526
|
+
source = node.d[i];
|
|
539
527
|
if (source.b) {
|
|
540
528
|
swap = source.b.indexOf(node);
|
|
541
529
|
source.b[swap] = source.b[source.b.length - 1];
|
|
542
530
|
source.b.pop();
|
|
543
531
|
if (!source.b.length)
|
|
544
|
-
(_a = source.
|
|
532
|
+
(_a = source.S) == null ? void 0 : _a.call(source);
|
|
545
533
|
}
|
|
546
534
|
}
|
|
547
535
|
}
|
|
@@ -555,10 +543,10 @@ function untrack(fn) {
|
|
|
555
543
|
}
|
|
556
544
|
function hasUpdated(fn) {
|
|
557
545
|
const current = updateCheck;
|
|
558
|
-
updateCheck = {
|
|
546
|
+
updateCheck = { e: false };
|
|
559
547
|
try {
|
|
560
548
|
fn();
|
|
561
|
-
return updateCheck.
|
|
549
|
+
return updateCheck.e;
|
|
562
550
|
} finally {
|
|
563
551
|
updateCheck = current;
|
|
564
552
|
}
|
|
@@ -571,7 +559,7 @@ function isPending(fn) {
|
|
|
571
559
|
return e instanceof NotReadyError;
|
|
572
560
|
}
|
|
573
561
|
}
|
|
574
|
-
function
|
|
562
|
+
function resolveSync(fn) {
|
|
575
563
|
const prevFlags = newFlags;
|
|
576
564
|
syncResolve = true;
|
|
577
565
|
try {
|
|
@@ -582,12 +570,21 @@ function latest(fn) {
|
|
|
582
570
|
syncResolve = false;
|
|
583
571
|
}
|
|
584
572
|
}
|
|
573
|
+
function catchError(fn) {
|
|
574
|
+
try {
|
|
575
|
+
fn();
|
|
576
|
+
} catch (e) {
|
|
577
|
+
if (e instanceof NotReadyError)
|
|
578
|
+
throw e;
|
|
579
|
+
return e;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
585
582
|
function compute(owner, compute2, observer) {
|
|
586
583
|
const prevOwner = setOwner(owner), prevObserver = currentObserver, prevMask = currentMask;
|
|
587
584
|
currentObserver = observer;
|
|
588
|
-
currentMask = (observer == null ? void 0 : observer.
|
|
585
|
+
currentMask = (observer == null ? void 0 : observer.M) ?? DEFAULT_FLAGS;
|
|
589
586
|
try {
|
|
590
|
-
return compute2(observer ? observer.
|
|
587
|
+
return compute2(observer ? observer.e : void 0);
|
|
591
588
|
} finally {
|
|
592
589
|
setOwner(prevOwner);
|
|
593
590
|
currentObserver = prevObserver;
|
|
@@ -601,88 +598,84 @@ function schedule() {
|
|
|
601
598
|
if (scheduled)
|
|
602
599
|
return;
|
|
603
600
|
scheduled = true;
|
|
604
|
-
if (!globalQueue.
|
|
601
|
+
if (!globalQueue.I)
|
|
605
602
|
queueMicrotask(flushSync);
|
|
606
603
|
}
|
|
607
604
|
var Queue = class {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
605
|
+
I = false;
|
|
606
|
+
t = [[], [], []];
|
|
607
|
+
E = [];
|
|
611
608
|
enqueue(type, node) {
|
|
612
|
-
this.
|
|
609
|
+
this.t[0].push(node);
|
|
613
610
|
if (type)
|
|
614
|
-
this.
|
|
611
|
+
this.t[type].push(node);
|
|
615
612
|
schedule();
|
|
616
613
|
}
|
|
617
614
|
run(type) {
|
|
618
|
-
if (this.
|
|
615
|
+
if (this.t[type].length) {
|
|
619
616
|
if (type === EFFECT_PURE) {
|
|
620
|
-
runPureQueue(this.
|
|
621
|
-
this.
|
|
617
|
+
runPureQueue(this.t[type]);
|
|
618
|
+
this.t[type] = [];
|
|
622
619
|
} else {
|
|
623
|
-
const effects = this.
|
|
624
|
-
this.
|
|
620
|
+
const effects = this.t[type];
|
|
621
|
+
this.t[type] = [];
|
|
625
622
|
runEffectQueue(effects);
|
|
626
623
|
}
|
|
627
624
|
}
|
|
628
|
-
|
|
629
|
-
|
|
625
|
+
let rerun = false;
|
|
626
|
+
for (let i = 0; i < this.E.length; i++) {
|
|
627
|
+
rerun = this.E[i].run(type) || rerun;
|
|
630
628
|
}
|
|
629
|
+
if (type === EFFECT_PURE && this.t[type].length)
|
|
630
|
+
return true;
|
|
631
631
|
}
|
|
632
632
|
flush() {
|
|
633
|
-
if (this.
|
|
633
|
+
if (this.I)
|
|
634
634
|
return;
|
|
635
|
-
this.
|
|
635
|
+
this.I = true;
|
|
636
636
|
try {
|
|
637
|
-
this.run(EFFECT_PURE)
|
|
637
|
+
while (this.run(EFFECT_PURE)) {
|
|
638
|
+
}
|
|
638
639
|
incrementClock();
|
|
639
640
|
scheduled = false;
|
|
640
641
|
this.run(EFFECT_RENDER);
|
|
641
642
|
this.run(EFFECT_USER);
|
|
642
643
|
} finally {
|
|
643
|
-
this.
|
|
644
|
+
this.I = false;
|
|
644
645
|
}
|
|
645
646
|
}
|
|
646
647
|
addChild(child) {
|
|
647
|
-
this.
|
|
648
|
+
this.E.push(child);
|
|
648
649
|
}
|
|
649
650
|
removeChild(child) {
|
|
650
|
-
const index = this.
|
|
651
|
+
const index = this.E.indexOf(child);
|
|
651
652
|
if (index >= 0)
|
|
652
|
-
this.
|
|
653
|
+
this.E.splice(index, 1);
|
|
653
654
|
}
|
|
654
655
|
};
|
|
655
656
|
var globalQueue = new Queue();
|
|
656
|
-
var globalTasks = [];
|
|
657
657
|
function flushSync() {
|
|
658
658
|
while (scheduled) {
|
|
659
659
|
globalQueue.flush();
|
|
660
|
-
for (let i = 0; i < globalTasks.length; i++)
|
|
661
|
-
globalTasks[i]();
|
|
662
|
-
globalTasks.length = 0;
|
|
663
660
|
}
|
|
664
661
|
}
|
|
665
|
-
function queueTask(fn) {
|
|
666
|
-
globalTasks.push(fn);
|
|
667
|
-
schedule();
|
|
668
|
-
}
|
|
669
662
|
function createBoundary(fn, queue) {
|
|
670
663
|
const owner = new Owner();
|
|
671
|
-
const parentQueue = owner.
|
|
672
|
-
parentQueue.addChild(owner.
|
|
673
|
-
onCleanup(() => parentQueue.removeChild(owner.
|
|
664
|
+
const parentQueue = owner.g || globalQueue;
|
|
665
|
+
parentQueue.addChild(owner.g = queue);
|
|
666
|
+
onCleanup(() => parentQueue.removeChild(owner.g));
|
|
674
667
|
return compute(owner, fn, null);
|
|
675
668
|
}
|
|
676
669
|
function runTop(node) {
|
|
677
670
|
const ancestors = [];
|
|
678
|
-
for (let current = node; current !== null; current = current.
|
|
671
|
+
for (let current = node; current !== null; current = current.r) {
|
|
679
672
|
if (current.a !== STATE_CLEAN) {
|
|
680
673
|
ancestors.push(current);
|
|
681
674
|
}
|
|
682
675
|
}
|
|
683
676
|
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
684
677
|
if (ancestors[i].a !== STATE_DISPOSED)
|
|
685
|
-
ancestors[i].
|
|
678
|
+
ancestors[i].x();
|
|
686
679
|
}
|
|
687
680
|
}
|
|
688
681
|
function runPureQueue(queue) {
|
|
@@ -693,101 +686,132 @@ function runPureQueue(queue) {
|
|
|
693
686
|
}
|
|
694
687
|
function runEffectQueue(queue) {
|
|
695
688
|
for (let i = 0; i < queue.length; i++)
|
|
696
|
-
queue[i].
|
|
689
|
+
queue[i].V();
|
|
697
690
|
}
|
|
698
691
|
|
|
699
692
|
// src/core/effect.ts
|
|
700
693
|
var Effect = class extends Computation {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
F;
|
|
694
|
+
J;
|
|
695
|
+
A;
|
|
704
696
|
B;
|
|
705
|
-
|
|
706
|
-
|
|
697
|
+
P = false;
|
|
698
|
+
K;
|
|
699
|
+
C;
|
|
700
|
+
g;
|
|
701
|
+
constructor(initialValue, compute2, effect, error, options) {
|
|
707
702
|
var _a;
|
|
708
703
|
super(initialValue, compute2, options);
|
|
709
|
-
this.
|
|
710
|
-
this.
|
|
711
|
-
this.
|
|
712
|
-
this.
|
|
713
|
-
this.
|
|
714
|
-
|
|
704
|
+
this.J = effect;
|
|
705
|
+
this.A = error;
|
|
706
|
+
this.K = initialValue;
|
|
707
|
+
this.C = (options == null ? void 0 : options.render) ? EFFECT_RENDER : EFFECT_USER;
|
|
708
|
+
this.g = ((_a = getOwner()) == null ? void 0 : _a.g) || globalQueue;
|
|
709
|
+
if (!(options == null ? void 0 : options.defer)) {
|
|
710
|
+
this.x();
|
|
711
|
+
this.C === EFFECT_USER ? this.g.enqueue(this.C, this) : this.V();
|
|
712
|
+
}
|
|
715
713
|
}
|
|
716
714
|
write(value, flags = 0) {
|
|
717
715
|
var _a, _b;
|
|
718
|
-
const currentFlags = this.
|
|
719
|
-
this.
|
|
720
|
-
if (this.
|
|
721
|
-
(_b = (_a = this.
|
|
716
|
+
const currentFlags = this.h;
|
|
717
|
+
this.h = flags;
|
|
718
|
+
if (this.C === EFFECT_RENDER && (flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
|
|
719
|
+
(_b = (_a = this.g).Q) == null ? void 0 : _b.call(_a, this);
|
|
722
720
|
}
|
|
723
721
|
if (value === UNCHANGED)
|
|
724
|
-
return this.
|
|
725
|
-
this.
|
|
726
|
-
this.
|
|
722
|
+
return this.e;
|
|
723
|
+
this.e = value;
|
|
724
|
+
this.P = true;
|
|
727
725
|
return value;
|
|
728
726
|
}
|
|
729
|
-
|
|
730
|
-
if (this.a >= state)
|
|
727
|
+
q(state, skipQueue) {
|
|
728
|
+
if (this.a >= state || skipQueue)
|
|
731
729
|
return;
|
|
732
730
|
if (this.a === STATE_CLEAN)
|
|
733
|
-
this.
|
|
731
|
+
this.g.enqueue(this.C, this);
|
|
734
732
|
this.a = state;
|
|
735
733
|
}
|
|
736
|
-
|
|
734
|
+
O(error) {
|
|
735
|
+
var _a, _b, _c;
|
|
736
|
+
(_a = this.B) == null ? void 0 : _a.call(this);
|
|
737
|
+
if (this.h & LOADING_BIT) {
|
|
738
|
+
this.h = 0;
|
|
739
|
+
(_c = (_b = this.g).Q) == null ? void 0 : _c.call(_b, this);
|
|
740
|
+
}
|
|
741
|
+
if (this.C === EFFECT_USER) {
|
|
742
|
+
try {
|
|
743
|
+
return this.A ? this.B = this.A(error) : console.error(new EffectError(this.J, error));
|
|
744
|
+
} catch (e) {
|
|
745
|
+
error = e;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
737
748
|
this.handleError(error);
|
|
738
749
|
}
|
|
739
|
-
|
|
750
|
+
y() {
|
|
751
|
+
var _a;
|
|
752
|
+
if (this.a === STATE_DISPOSED)
|
|
753
|
+
return;
|
|
754
|
+
this.J = void 0;
|
|
740
755
|
this.K = void 0;
|
|
741
|
-
this.
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
756
|
+
this.A = void 0;
|
|
757
|
+
(_a = this.B) == null ? void 0 : _a.call(this);
|
|
758
|
+
this.B = void 0;
|
|
759
|
+
super.y();
|
|
760
|
+
}
|
|
761
|
+
V() {
|
|
762
|
+
var _a;
|
|
763
|
+
if (this.P && this.a !== STATE_DISPOSED) {
|
|
764
|
+
(_a = this.B) == null ? void 0 : _a.call(this);
|
|
765
|
+
try {
|
|
766
|
+
this.B = this.J(this.e, this.K);
|
|
767
|
+
} catch (e) {
|
|
768
|
+
this.handleError(e);
|
|
769
|
+
} finally {
|
|
770
|
+
this.K = this.e;
|
|
771
|
+
this.P = false;
|
|
772
|
+
}
|
|
749
773
|
}
|
|
750
774
|
}
|
|
751
775
|
};
|
|
752
776
|
var EagerComputation = class extends Computation {
|
|
753
|
-
|
|
777
|
+
g;
|
|
754
778
|
constructor(initialValue, compute2, options) {
|
|
755
779
|
var _a;
|
|
756
780
|
super(initialValue, compute2, options);
|
|
757
|
-
this.
|
|
758
|
-
this.
|
|
781
|
+
this.g = ((_a = getOwner()) == null ? void 0 : _a.g) || globalQueue;
|
|
782
|
+
this.x();
|
|
759
783
|
}
|
|
760
|
-
|
|
761
|
-
if (this.a >= state)
|
|
784
|
+
q(state, skipQueue) {
|
|
785
|
+
if (this.a >= state && !this.H)
|
|
762
786
|
return;
|
|
763
|
-
if (this.a === STATE_CLEAN)
|
|
764
|
-
this.
|
|
765
|
-
super.
|
|
787
|
+
if (this.a === STATE_CLEAN && !skipQueue)
|
|
788
|
+
this.g.enqueue(EFFECT_PURE, this);
|
|
789
|
+
super.q(state, skipQueue);
|
|
766
790
|
}
|
|
767
791
|
};
|
|
768
792
|
|
|
769
793
|
// src/core/suspense.ts
|
|
770
794
|
var SuspenseQueue = class extends Queue {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
795
|
+
c = /* @__PURE__ */ new Set();
|
|
796
|
+
o = false;
|
|
797
|
+
R = new Computation(false, null);
|
|
774
798
|
run(type) {
|
|
775
|
-
if (type && this.
|
|
799
|
+
if (type && this.o)
|
|
776
800
|
return;
|
|
777
|
-
super.run(type);
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
if (node.
|
|
781
|
-
this.
|
|
782
|
-
if (!this.
|
|
783
|
-
this.
|
|
784
|
-
|
|
801
|
+
return super.run(type);
|
|
802
|
+
}
|
|
803
|
+
Q(node) {
|
|
804
|
+
if (node.h & LOADING_BIT) {
|
|
805
|
+
this.c.add(node);
|
|
806
|
+
if (!this.o) {
|
|
807
|
+
this.o = true;
|
|
808
|
+
this.R.write(true);
|
|
785
809
|
}
|
|
786
810
|
} else {
|
|
787
|
-
this.
|
|
788
|
-
if (this.
|
|
789
|
-
this.
|
|
790
|
-
|
|
811
|
+
this.c.delete(node);
|
|
812
|
+
if (this.c.size === 0) {
|
|
813
|
+
this.o = false;
|
|
814
|
+
this.R.write(false);
|
|
791
815
|
}
|
|
792
816
|
}
|
|
793
817
|
}
|
|
@@ -795,12 +819,12 @@ var SuspenseQueue = class extends Queue {
|
|
|
795
819
|
var LiveComputation = class extends EagerComputation {
|
|
796
820
|
write(value, flags = 0) {
|
|
797
821
|
var _a, _b;
|
|
798
|
-
const currentFlags = this.
|
|
822
|
+
const currentFlags = this.h;
|
|
799
823
|
super.write(value, flags);
|
|
800
824
|
if ((flags & LOADING_BIT) !== (currentFlags & LOADING_BIT)) {
|
|
801
|
-
(_b = (_a = this.
|
|
825
|
+
(_b = (_a = this.g).Q) == null ? void 0 : _b.call(_a, this);
|
|
802
826
|
}
|
|
803
|
-
return this.
|
|
827
|
+
return this.e;
|
|
804
828
|
}
|
|
805
829
|
};
|
|
806
830
|
function createSuspense(fn, fallback) {
|
|
@@ -809,7 +833,7 @@ function createSuspense(fn, fallback) {
|
|
|
809
833
|
const child = new Computation(null, fn);
|
|
810
834
|
return new LiveComputation(null, () => flatten(child.wait()));
|
|
811
835
|
}, queue);
|
|
812
|
-
const equality = new Computation(null, () => queue.
|
|
836
|
+
const equality = new Computation(null, () => queue.R.read() || queue.o);
|
|
813
837
|
const comp = new Computation(null, () => equality.read() ? fallback() : tree.read());
|
|
814
838
|
return comp.read.bind(comp);
|
|
815
839
|
}
|
|
@@ -841,10 +865,10 @@ function createMemo(compute2, value, options) {
|
|
|
841
865
|
var _a, _b, _c;
|
|
842
866
|
if (node) {
|
|
843
867
|
resolvedValue = node.wait();
|
|
844
|
-
if (!((_a = node.
|
|
868
|
+
if (!((_a = node.d) == null ? void 0 : _a.length) && ((_b = node.n) == null ? void 0 : _b.r) !== node) {
|
|
845
869
|
node.dispose();
|
|
846
870
|
node = void 0;
|
|
847
|
-
} else if (!node.
|
|
871
|
+
} else if (!node.r && !((_c = node.b) == null ? void 0 : _c.length)) {
|
|
848
872
|
node.dispose();
|
|
849
873
|
node.a = STATE_UNINITIALIZED;
|
|
850
874
|
}
|
|
@@ -855,10 +879,10 @@ function createMemo(compute2, value, options) {
|
|
|
855
879
|
function createAsync(compute2, value, options) {
|
|
856
880
|
const lhs = new EagerComputation(
|
|
857
881
|
{
|
|
858
|
-
|
|
882
|
+
e: value
|
|
859
883
|
},
|
|
860
884
|
(p) => {
|
|
861
|
-
const value2 = p == null ? void 0 : p.
|
|
885
|
+
const value2 = p == null ? void 0 : p.e;
|
|
862
886
|
const source = compute2(value2);
|
|
863
887
|
const isPromise = source instanceof Promise;
|
|
864
888
|
const iterator = source[Symbol.asyncIterator];
|
|
@@ -867,10 +891,18 @@ function createAsync(compute2, value, options) {
|
|
|
867
891
|
wait() {
|
|
868
892
|
return source;
|
|
869
893
|
},
|
|
870
|
-
|
|
894
|
+
e: source
|
|
871
895
|
};
|
|
872
896
|
}
|
|
873
897
|
const signal = new Computation(value2, null, options);
|
|
898
|
+
const w = signal.wait;
|
|
899
|
+
signal.wait = function() {
|
|
900
|
+
if (signal.h & ERROR_BIT && signal.z <= getClock()) {
|
|
901
|
+
lhs.q(STATE_DIRTY);
|
|
902
|
+
throw new NotReadyError();
|
|
903
|
+
}
|
|
904
|
+
return w.call(this);
|
|
905
|
+
};
|
|
874
906
|
signal.write(UNCHANGED, LOADING_BIT);
|
|
875
907
|
if (isPromise) {
|
|
876
908
|
source.then(
|
|
@@ -901,16 +933,17 @@ function createAsync(compute2, value, options) {
|
|
|
901
933
|
);
|
|
902
934
|
return () => lhs.wait().wait();
|
|
903
935
|
}
|
|
904
|
-
function createEffect(compute2, effect, value, options) {
|
|
936
|
+
function createEffect(compute2, effect, error, value, options) {
|
|
905
937
|
void new Effect(
|
|
906
938
|
value,
|
|
907
939
|
compute2,
|
|
908
940
|
effect,
|
|
941
|
+
error,
|
|
909
942
|
void 0
|
|
910
943
|
);
|
|
911
944
|
}
|
|
912
945
|
function createRenderEffect(compute2, effect, value, options) {
|
|
913
|
-
void new Effect(value, compute2, effect, {
|
|
946
|
+
void new Effect(value, compute2, effect, void 0, {
|
|
914
947
|
render: true,
|
|
915
948
|
...void 0
|
|
916
949
|
});
|
|
@@ -931,14 +964,14 @@ function createErrorBoundary(fn, fallback) {
|
|
|
931
964
|
const owner = new Owner();
|
|
932
965
|
const error = new Computation(null, null);
|
|
933
966
|
const reset = new Computation(null, null, { equals: false });
|
|
934
|
-
const handler = (err) => error.write({
|
|
935
|
-
owner.
|
|
967
|
+
const handler = (err) => error.write({ A: err });
|
|
968
|
+
owner.m = owner.m ? [handler, ...owner.m] : [handler];
|
|
936
969
|
const guarded = compute(
|
|
937
970
|
owner,
|
|
938
971
|
() => {
|
|
939
972
|
const c = new Computation(null, () => (reset.read(), fn()));
|
|
940
973
|
const f = new Computation(null, () => flatten(c.read()));
|
|
941
|
-
f.
|
|
974
|
+
f.O = function(error2) {
|
|
942
975
|
this.handleError(error2);
|
|
943
976
|
};
|
|
944
977
|
return f;
|
|
@@ -951,13 +984,78 @@ function createErrorBoundary(fn, fallback) {
|
|
|
951
984
|
if (!error.read())
|
|
952
985
|
return resolved;
|
|
953
986
|
}
|
|
954
|
-
return fallback(error.read().
|
|
987
|
+
return fallback(error.read().A, () => {
|
|
955
988
|
error.write(null);
|
|
956
989
|
reset.write(null);
|
|
957
990
|
});
|
|
958
991
|
});
|
|
959
992
|
return decision.read.bind(decision);
|
|
960
993
|
}
|
|
994
|
+
function resolve(fn) {
|
|
995
|
+
return new Promise((res, rej) => {
|
|
996
|
+
let node = new EagerComputation(void 0, () => {
|
|
997
|
+
try {
|
|
998
|
+
res(fn());
|
|
999
|
+
} catch (err) {
|
|
1000
|
+
if (err instanceof NotReadyError)
|
|
1001
|
+
throw err;
|
|
1002
|
+
rej(err);
|
|
1003
|
+
}
|
|
1004
|
+
node.dispose(true);
|
|
1005
|
+
});
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
function createReaction(effect, error, options) {
|
|
1009
|
+
const node = new Effect(void 0, () => {
|
|
1010
|
+
}, effect, error, {
|
|
1011
|
+
defer: true,
|
|
1012
|
+
...void 0
|
|
1013
|
+
});
|
|
1014
|
+
return (tracking) => {
|
|
1015
|
+
node.w = tracking;
|
|
1016
|
+
node.a = STATE_DIRTY;
|
|
1017
|
+
node.x();
|
|
1018
|
+
node.w = null;
|
|
1019
|
+
};
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
// src/store/projection.ts
|
|
1023
|
+
var ProjectionComputation = class extends EagerComputation {
|
|
1024
|
+
q(state, skipQueue) {
|
|
1025
|
+
if (this.a >= state && !this.H)
|
|
1026
|
+
return;
|
|
1027
|
+
if (this.a === STATE_CLEAN && !skipQueue)
|
|
1028
|
+
this.g.enqueue(EFFECT_PURE, this);
|
|
1029
|
+
super.q(state, true);
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
function createProjection(fn, initialValue = {}) {
|
|
1033
|
+
const [store, setStore] = createStore(initialValue);
|
|
1034
|
+
const node = new ProjectionComputation(void 0, () => {
|
|
1035
|
+
setStore(fn);
|
|
1036
|
+
});
|
|
1037
|
+
const wrapped = /* @__PURE__ */ new WeakMap();
|
|
1038
|
+
return wrap(store, node, wrapped);
|
|
1039
|
+
}
|
|
1040
|
+
function wrap(source, node, wrapped) {
|
|
1041
|
+
if (wrapped.has(source))
|
|
1042
|
+
return wrapped.get(source);
|
|
1043
|
+
const wrap3 = new Proxy(source, {
|
|
1044
|
+
get(target, property) {
|
|
1045
|
+
node.read();
|
|
1046
|
+
const v = target[property];
|
|
1047
|
+
return isWrappable(v) ? wrap3(v, node, wrapped) : v;
|
|
1048
|
+
},
|
|
1049
|
+
set() {
|
|
1050
|
+
throw new Error("Projections are readonly");
|
|
1051
|
+
},
|
|
1052
|
+
deleteProperty() {
|
|
1053
|
+
throw new Error("Projections are readonly");
|
|
1054
|
+
}
|
|
1055
|
+
});
|
|
1056
|
+
wrapped.set(source, wrap3);
|
|
1057
|
+
return wrap3;
|
|
1058
|
+
}
|
|
961
1059
|
|
|
962
1060
|
// src/store/store.ts
|
|
963
1061
|
var $RAW = Symbol(0);
|
|
@@ -967,7 +1065,7 @@ var $PROXY = Symbol(0);
|
|
|
967
1065
|
var STORE_VALUE = "v";
|
|
968
1066
|
var STORE_NODE = "n";
|
|
969
1067
|
var STORE_HAS = "h";
|
|
970
|
-
function
|
|
1068
|
+
function wrap2(value) {
|
|
971
1069
|
let p = value[$PROXY];
|
|
972
1070
|
if (!p) {
|
|
973
1071
|
let target;
|
|
@@ -1075,8 +1173,8 @@ var proxyTraps = {
|
|
|
1075
1173
|
return desc.get.call(receiver);
|
|
1076
1174
|
}
|
|
1077
1175
|
if (Writing.has(storeValue)) {
|
|
1078
|
-
const value2 = tracked ? tracked.
|
|
1079
|
-
return isWrappable(value2) ? (Writing.add(value2[$RAW] || value2),
|
|
1176
|
+
const value2 = tracked ? tracked.e : storeValue[property];
|
|
1177
|
+
return isWrappable(value2) ? (Writing.add(value2[$RAW] || value2), wrap2(value2)) : value2;
|
|
1080
1178
|
}
|
|
1081
1179
|
let value = tracked ? nodes[property].read() : storeValue[property];
|
|
1082
1180
|
if (!tracked) {
|
|
@@ -1084,10 +1182,10 @@ var proxyTraps = {
|
|
|
1084
1182
|
let proto;
|
|
1085
1183
|
return !Array.isArray(storeValue) && (proto = Object.getPrototypeOf(storeValue)) && proto !== Object.prototype ? value.bind(storeValue) : value;
|
|
1086
1184
|
} else if (getObserver()) {
|
|
1087
|
-
value = getNode(nodes, property, isWrappable(value) ?
|
|
1185
|
+
value = getNode(nodes, property, isWrappable(value) ? wrap2(value) : value).read();
|
|
1088
1186
|
}
|
|
1089
1187
|
}
|
|
1090
|
-
return isWrappable(value) ?
|
|
1188
|
+
return isWrappable(value) ? wrap2(value) : value;
|
|
1091
1189
|
},
|
|
1092
1190
|
has(target, property) {
|
|
1093
1191
|
if (property === $RAW || property === $PROXY || property === $TRACK || property === "__proto__")
|
|
@@ -1130,13 +1228,16 @@ function setProperty(state, property, value, deleting = false) {
|
|
|
1130
1228
|
const nodes = getNodes(target, STORE_NODE);
|
|
1131
1229
|
let node;
|
|
1132
1230
|
if (node = nodes[property])
|
|
1133
|
-
node.write(isWrappable(value) ?
|
|
1231
|
+
node.write(isWrappable(value) ? wrap2(value) : value);
|
|
1134
1232
|
Array.isArray(state) && state.length !== len && (node = nodes.length) && node.write(state.length);
|
|
1135
1233
|
(node = nodes[$TRACK]) && node.write(void 0);
|
|
1136
1234
|
}
|
|
1137
1235
|
function createStore(first, second) {
|
|
1138
|
-
const derived = typeof first === "function", store = derived ? second : first
|
|
1139
|
-
|
|
1236
|
+
const derived = typeof first === "function", store = derived ? second : first;
|
|
1237
|
+
if (derived)
|
|
1238
|
+
return createProjection(first, store);
|
|
1239
|
+
const unwrappedStore = unwrap(store, false);
|
|
1240
|
+
const wrappedStore = wrap2(unwrappedStore);
|
|
1140
1241
|
const setStore = (fn) => {
|
|
1141
1242
|
try {
|
|
1142
1243
|
Writing.add(unwrappedStore);
|
|
@@ -1145,15 +1246,8 @@ function createStore(first, second) {
|
|
|
1145
1246
|
Writing.clear();
|
|
1146
1247
|
}
|
|
1147
1248
|
};
|
|
1148
|
-
if (derived) {
|
|
1149
|
-
new EagerComputation(void 0, () => setStore(first));
|
|
1150
|
-
}
|
|
1151
1249
|
return [wrappedStore, setStore];
|
|
1152
1250
|
}
|
|
1153
|
-
function createProjection(fn, initialValue = {}) {
|
|
1154
|
-
const [store] = createStore(fn, initialValue);
|
|
1155
|
-
return store;
|
|
1156
|
-
}
|
|
1157
1251
|
|
|
1158
1252
|
// src/store/reconcile.ts
|
|
1159
1253
|
function applyState(next, state, keyFn) {
|
|
@@ -1175,7 +1269,7 @@ function applyState(next, state, keyFn) {
|
|
|
1175
1269
|
if (next.length && previous.length && next[0] && keyFn(next[0]) != null) {
|
|
1176
1270
|
let i, j, start, end, newEnd, item, newIndicesNext, keyVal;
|
|
1177
1271
|
for (start = 0, end = Math.min(previous.length, next.length); start < end && (previous[start] === next[start] || previous[start] && next[start] && keyFn(previous[start]) === keyFn(next[start])); start++) {
|
|
1178
|
-
applyState(next[start],
|
|
1272
|
+
applyState(next[start], wrap2(previous[start]), keyFn);
|
|
1179
1273
|
}
|
|
1180
1274
|
const temp = new Array(next.length), newIndices = /* @__PURE__ */ new Map();
|
|
1181
1275
|
for (end = previous.length - 1, newEnd = next.length - 1; end >= start && newEnd >= start && (previous[end] === next[newEnd] || previous[end] && next[newEnd] && keyFn(previous[end]) === keyFn(next[newEnd])); end--, newEnd--) {
|
|
@@ -1184,11 +1278,11 @@ function applyState(next, state, keyFn) {
|
|
|
1184
1278
|
if (start > newEnd || start > end) {
|
|
1185
1279
|
for (j = start; j <= newEnd; j++) {
|
|
1186
1280
|
changed = true;
|
|
1187
|
-
(_a = target[STORE_NODE][j]) == null ? void 0 : _a.write(
|
|
1281
|
+
(_a = target[STORE_NODE][j]) == null ? void 0 : _a.write(wrap2(next[j]));
|
|
1188
1282
|
}
|
|
1189
1283
|
for (; j < next.length; j++) {
|
|
1190
1284
|
changed = true;
|
|
1191
|
-
const wrapped =
|
|
1285
|
+
const wrapped = wrap2(temp[j]);
|
|
1192
1286
|
(_b = target[STORE_NODE][j]) == null ? void 0 : _b.write(wrapped);
|
|
1193
1287
|
applyState(next[j], wrapped, keyFn);
|
|
1194
1288
|
}
|
|
@@ -1216,17 +1310,17 @@ function applyState(next, state, keyFn) {
|
|
|
1216
1310
|
}
|
|
1217
1311
|
for (j = start; j < next.length; j++) {
|
|
1218
1312
|
if (j in temp) {
|
|
1219
|
-
const wrapped =
|
|
1313
|
+
const wrapped = wrap2(temp[j]);
|
|
1220
1314
|
(_e = target[STORE_NODE][j]) == null ? void 0 : _e.write(wrapped);
|
|
1221
1315
|
applyState(next[j], wrapped, keyFn);
|
|
1222
1316
|
} else
|
|
1223
|
-
(_f = target[STORE_NODE][j]) == null ? void 0 : _f.write(
|
|
1317
|
+
(_f = target[STORE_NODE][j]) == null ? void 0 : _f.write(wrap2(next[j]));
|
|
1224
1318
|
}
|
|
1225
1319
|
if (start < next.length)
|
|
1226
1320
|
changed = true;
|
|
1227
1321
|
} else if (previous.length && next.length) {
|
|
1228
1322
|
for (let i = 0, len = next.length; i < len; i++) {
|
|
1229
|
-
isWrappable(previous[i]) && applyState(next[i],
|
|
1323
|
+
isWrappable(previous[i]) && applyState(next[i], wrap2(previous[i]), keyFn);
|
|
1230
1324
|
}
|
|
1231
1325
|
}
|
|
1232
1326
|
if (previous.length !== next.length) {
|
|
@@ -1246,9 +1340,9 @@ function applyState(next, state, keyFn) {
|
|
|
1246
1340
|
if (previousValue === nextValue)
|
|
1247
1341
|
continue;
|
|
1248
1342
|
if (!previousValue || !isWrappable(previousValue) || keyFn(previousValue) != null && keyFn(previousValue) !== keyFn(nextValue))
|
|
1249
|
-
node.write(isWrappable(nextValue) ?
|
|
1343
|
+
node.write(isWrappable(nextValue) ? wrap2(nextValue) : nextValue);
|
|
1250
1344
|
else
|
|
1251
|
-
applyState(nextValue,
|
|
1345
|
+
applyState(nextValue, wrap2(previousValue), keyFn);
|
|
1252
1346
|
}
|
|
1253
1347
|
}
|
|
1254
1348
|
if (nodes = target[STORE_HAS]) {
|
|
@@ -1420,120 +1514,166 @@ function omit(props, ...keys) {
|
|
|
1420
1514
|
function mapArray(list, map, options) {
|
|
1421
1515
|
const keyFn = typeof (options == null ? void 0 : options.keyed) === "function" ? options.keyed : void 0;
|
|
1422
1516
|
return updateKeyedMap.bind({
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1517
|
+
F: new Owner(),
|
|
1518
|
+
i: 0,
|
|
1519
|
+
W: list,
|
|
1520
|
+
u: [],
|
|
1521
|
+
G: map,
|
|
1522
|
+
f: [],
|
|
1523
|
+
c: [],
|
|
1524
|
+
D: keyFn,
|
|
1525
|
+
j: keyFn || (options == null ? void 0 : options.keyed) === false ? [] : void 0,
|
|
1526
|
+
k: map.length > 1 ? [] : void 0,
|
|
1527
|
+
o: options == null ? void 0 : options.fallback
|
|
1434
1528
|
});
|
|
1435
1529
|
}
|
|
1436
1530
|
function updateKeyedMap() {
|
|
1437
|
-
const newItems = this.
|
|
1531
|
+
const newItems = this.W() || [], newLen = newItems.length;
|
|
1438
1532
|
newItems[$TRACK];
|
|
1439
|
-
runWithOwner(this.
|
|
1440
|
-
let i, j, mapper = this.
|
|
1441
|
-
this.
|
|
1442
|
-
this.
|
|
1443
|
-
return this.
|
|
1444
|
-
Computation.prototype.read.bind(this.
|
|
1445
|
-
this.
|
|
1533
|
+
runWithOwner(this.F, () => {
|
|
1534
|
+
let i, j, mapper = this.j ? () => {
|
|
1535
|
+
this.j[j] = new Computation(newItems[j], null);
|
|
1536
|
+
this.k && (this.k[j] = new Computation(j, null));
|
|
1537
|
+
return this.G(
|
|
1538
|
+
Computation.prototype.read.bind(this.j[j]),
|
|
1539
|
+
this.k ? Computation.prototype.read.bind(this.k[j]) : void 0
|
|
1446
1540
|
);
|
|
1447
|
-
} : this.
|
|
1541
|
+
} : this.k ? () => {
|
|
1448
1542
|
const item = newItems[j];
|
|
1449
|
-
this.
|
|
1450
|
-
return this.
|
|
1543
|
+
this.k[j] = new Computation(j, null);
|
|
1544
|
+
return this.G(() => item, Computation.prototype.read.bind(this.k[j]));
|
|
1451
1545
|
} : () => {
|
|
1452
1546
|
const item = newItems[j];
|
|
1453
|
-
return this.
|
|
1547
|
+
return this.G(() => item);
|
|
1454
1548
|
};
|
|
1455
1549
|
if (newLen === 0) {
|
|
1456
|
-
if (this.
|
|
1457
|
-
this.
|
|
1458
|
-
this.
|
|
1459
|
-
this.
|
|
1460
|
-
this.
|
|
1461
|
-
this.
|
|
1462
|
-
this.
|
|
1463
|
-
this.
|
|
1550
|
+
if (this.i !== 0) {
|
|
1551
|
+
this.F.dispose(false);
|
|
1552
|
+
this.c = [];
|
|
1553
|
+
this.u = [];
|
|
1554
|
+
this.f = [];
|
|
1555
|
+
this.i = 0;
|
|
1556
|
+
this.j && (this.j = []);
|
|
1557
|
+
this.k && (this.k = []);
|
|
1464
1558
|
}
|
|
1465
|
-
if (this.
|
|
1466
|
-
this.
|
|
1467
|
-
this.
|
|
1468
|
-
this.
|
|
1559
|
+
if (this.o && !this.f[0]) {
|
|
1560
|
+
this.f[0] = compute(
|
|
1561
|
+
this.c[0] = new Owner(),
|
|
1562
|
+
this.o,
|
|
1469
1563
|
null
|
|
1470
1564
|
);
|
|
1471
1565
|
}
|
|
1472
|
-
} else if (this.
|
|
1473
|
-
if (this.
|
|
1474
|
-
this.
|
|
1475
|
-
this.
|
|
1566
|
+
} else if (this.i === 0) {
|
|
1567
|
+
if (this.c[0])
|
|
1568
|
+
this.c[0].dispose();
|
|
1569
|
+
this.f = new Array(newLen);
|
|
1476
1570
|
for (j = 0; j < newLen; j++) {
|
|
1477
|
-
this.
|
|
1478
|
-
this.
|
|
1571
|
+
this.u[j] = newItems[j];
|
|
1572
|
+
this.f[j] = compute(this.c[j] = new Owner(), mapper, null);
|
|
1479
1573
|
}
|
|
1480
|
-
this.
|
|
1574
|
+
this.i = newLen;
|
|
1481
1575
|
} else {
|
|
1482
|
-
let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.
|
|
1483
|
-
for (start = 0, end = Math.min(this.
|
|
1484
|
-
if (this.
|
|
1485
|
-
this.
|
|
1576
|
+
let start, end, newEnd, item, key, newIndices, newIndicesNext, temp = new Array(newLen), tempNodes = new Array(newLen), tempRows = this.j ? new Array(newLen) : void 0, tempIndexes = this.k ? new Array(newLen) : void 0;
|
|
1577
|
+
for (start = 0, end = Math.min(this.i, newLen); start < end && (this.u[start] === newItems[start] || this.j && compare(this.D, this.u[start], newItems[start])); start++) {
|
|
1578
|
+
if (this.j)
|
|
1579
|
+
this.j[start].write(newItems[start]);
|
|
1486
1580
|
}
|
|
1487
|
-
for (end = this.
|
|
1488
|
-
temp[newEnd] = this.
|
|
1489
|
-
tempNodes[newEnd] = this.
|
|
1490
|
-
tempRows && (tempRows[newEnd] = this.
|
|
1491
|
-
tempIndexes && (tempIndexes[newEnd] = this.
|
|
1581
|
+
for (end = this.i - 1, newEnd = newLen - 1; end >= start && newEnd >= start && (this.u[end] === newItems[newEnd] || this.j && compare(this.D, this.u[end], newItems[newEnd])); end--, newEnd--) {
|
|
1582
|
+
temp[newEnd] = this.f[end];
|
|
1583
|
+
tempNodes[newEnd] = this.c[end];
|
|
1584
|
+
tempRows && (tempRows[newEnd] = this.j[end]);
|
|
1585
|
+
tempIndexes && (tempIndexes[newEnd] = this.k[end]);
|
|
1492
1586
|
}
|
|
1493
1587
|
newIndices = /* @__PURE__ */ new Map();
|
|
1494
1588
|
newIndicesNext = new Array(newEnd + 1);
|
|
1495
1589
|
for (j = newEnd; j >= start; j--) {
|
|
1496
1590
|
item = newItems[j];
|
|
1497
|
-
key = this.
|
|
1591
|
+
key = this.D ? this.D(item) : item;
|
|
1498
1592
|
i = newIndices.get(key);
|
|
1499
1593
|
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
1500
1594
|
newIndices.set(key, j);
|
|
1501
1595
|
}
|
|
1502
1596
|
for (i = start; i <= end; i++) {
|
|
1503
|
-
item = this.
|
|
1504
|
-
key = this.
|
|
1597
|
+
item = this.u[i];
|
|
1598
|
+
key = this.D ? this.D(item) : item;
|
|
1505
1599
|
j = newIndices.get(key);
|
|
1506
1600
|
if (j !== void 0 && j !== -1) {
|
|
1507
|
-
temp[j] = this.
|
|
1508
|
-
tempNodes[j] = this.
|
|
1509
|
-
tempRows && (tempRows[j] = this.
|
|
1510
|
-
tempIndexes && (tempIndexes[j] = this.
|
|
1601
|
+
temp[j] = this.f[i];
|
|
1602
|
+
tempNodes[j] = this.c[i];
|
|
1603
|
+
tempRows && (tempRows[j] = this.j[i]);
|
|
1604
|
+
tempIndexes && (tempIndexes[j] = this.k[i]);
|
|
1511
1605
|
j = newIndicesNext[j];
|
|
1512
1606
|
newIndices.set(key, j);
|
|
1513
1607
|
} else
|
|
1514
|
-
this.
|
|
1608
|
+
this.c[i].dispose();
|
|
1515
1609
|
}
|
|
1516
1610
|
for (j = start; j < newLen; j++) {
|
|
1517
1611
|
if (j in temp) {
|
|
1518
|
-
this.
|
|
1519
|
-
this.
|
|
1612
|
+
this.f[j] = temp[j];
|
|
1613
|
+
this.c[j] = tempNodes[j];
|
|
1520
1614
|
if (tempRows) {
|
|
1521
|
-
this.
|
|
1522
|
-
this.
|
|
1615
|
+
this.j[j] = tempRows[j];
|
|
1616
|
+
this.j[j].write(newItems[j]);
|
|
1523
1617
|
}
|
|
1524
1618
|
if (tempIndexes) {
|
|
1525
|
-
this.
|
|
1526
|
-
this.
|
|
1619
|
+
this.k[j] = tempIndexes[j];
|
|
1620
|
+
this.k[j].write(j);
|
|
1527
1621
|
}
|
|
1528
1622
|
} else {
|
|
1529
|
-
this.
|
|
1623
|
+
this.f[j] = compute(this.c[j] = new Owner(), mapper, null);
|
|
1530
1624
|
}
|
|
1531
1625
|
}
|
|
1532
|
-
this.
|
|
1533
|
-
this.
|
|
1626
|
+
this.f = this.f.slice(0, this.i = newLen);
|
|
1627
|
+
this.u = newItems.slice(0);
|
|
1628
|
+
}
|
|
1629
|
+
});
|
|
1630
|
+
return this.f;
|
|
1631
|
+
}
|
|
1632
|
+
function repeat(count, map, options) {
|
|
1633
|
+
return updateRepeat.bind({
|
|
1634
|
+
F: new Owner(),
|
|
1635
|
+
i: 0,
|
|
1636
|
+
X: count,
|
|
1637
|
+
G: map,
|
|
1638
|
+
c: [],
|
|
1639
|
+
f: [],
|
|
1640
|
+
o: options == null ? void 0 : options.fallback
|
|
1641
|
+
});
|
|
1642
|
+
}
|
|
1643
|
+
function updateRepeat() {
|
|
1644
|
+
const newLen = this.X();
|
|
1645
|
+
runWithOwner(this.F, () => {
|
|
1646
|
+
if (newLen === 0) {
|
|
1647
|
+
if (this.i !== 0) {
|
|
1648
|
+
this.F.dispose(false);
|
|
1649
|
+
this.c = [];
|
|
1650
|
+
this.f = [];
|
|
1651
|
+
this.i = 0;
|
|
1652
|
+
}
|
|
1653
|
+
if (this.o && !this.f[0]) {
|
|
1654
|
+
this.f[0] = compute(
|
|
1655
|
+
this.c[0] = new Owner(),
|
|
1656
|
+
this.o,
|
|
1657
|
+
null
|
|
1658
|
+
);
|
|
1659
|
+
}
|
|
1660
|
+
} else {
|
|
1661
|
+
if (this.i === 0 && this.c[0])
|
|
1662
|
+
this.c[0].dispose();
|
|
1663
|
+
for (let i = this.i; i < newLen; i++) {
|
|
1664
|
+
this.f[i] = compute(
|
|
1665
|
+
this.c[i] = new Owner(),
|
|
1666
|
+
() => this.G(i),
|
|
1667
|
+
null
|
|
1668
|
+
);
|
|
1669
|
+
}
|
|
1670
|
+
for (let i = newLen; i < this.i; i++)
|
|
1671
|
+
this.c[i].dispose();
|
|
1672
|
+
this.f = this.f.slice(0, newLen);
|
|
1673
|
+
this.i = newLen;
|
|
1534
1674
|
}
|
|
1535
1675
|
});
|
|
1536
|
-
return this.
|
|
1676
|
+
return this.f;
|
|
1537
1677
|
}
|
|
1538
1678
|
function compare(key, a, b) {
|
|
1539
1679
|
return key ? key(a) === key(b) : true;
|
|
@@ -1550,6 +1690,7 @@ exports.NotReadyError = NotReadyError;
|
|
|
1550
1690
|
exports.Owner = Owner;
|
|
1551
1691
|
exports.Queue = Queue;
|
|
1552
1692
|
exports.SUPPORTS_PROXY = SUPPORTS_PROXY;
|
|
1693
|
+
exports.catchError = catchError;
|
|
1553
1694
|
exports.createAsync = createAsync;
|
|
1554
1695
|
exports.createBoundary = createBoundary;
|
|
1555
1696
|
exports.createContext = createContext;
|
|
@@ -1557,6 +1698,7 @@ exports.createEffect = createEffect;
|
|
|
1557
1698
|
exports.createErrorBoundary = createErrorBoundary;
|
|
1558
1699
|
exports.createMemo = createMemo;
|
|
1559
1700
|
exports.createProjection = createProjection;
|
|
1701
|
+
exports.createReaction = createReaction;
|
|
1560
1702
|
exports.createRenderEffect = createRenderEffect;
|
|
1561
1703
|
exports.createRoot = createRoot;
|
|
1562
1704
|
exports.createSignal = createSignal;
|
|
@@ -1572,12 +1714,14 @@ exports.hasUpdated = hasUpdated;
|
|
|
1572
1714
|
exports.isEqual = isEqual;
|
|
1573
1715
|
exports.isPending = isPending;
|
|
1574
1716
|
exports.isWrappable = isWrappable;
|
|
1575
|
-
exports.latest = latest;
|
|
1576
1717
|
exports.mapArray = mapArray;
|
|
1577
1718
|
exports.merge = merge;
|
|
1578
1719
|
exports.omit = omit;
|
|
1579
1720
|
exports.onCleanup = onCleanup;
|
|
1580
1721
|
exports.reconcile = reconcile;
|
|
1722
|
+
exports.repeat = repeat;
|
|
1723
|
+
exports.resolve = resolve;
|
|
1724
|
+
exports.resolveSync = resolveSync;
|
|
1581
1725
|
exports.runWithOwner = runWithOwner;
|
|
1582
1726
|
exports.setContext = setContext;
|
|
1583
1727
|
exports.untrack = untrack;
|