@graphrefly/graphrefly 0.12.0 → 0.14.0
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/README.md +1 -1
- package/dist/{chunk-NULSP7U4.js → chunk-2ZICUAUJ.js} +4 -4
- package/dist/{chunk-BRPCN2HJ.js → chunk-4APC3AFN.js} +3 -3
- package/dist/{chunk-VQWLA6XQ.js → chunk-CRACCCJY.js} +3 -3
- package/dist/{chunk-JYRHO63K.js → chunk-GKRKDYNT.js} +17 -17
- package/dist/chunk-GKRKDYNT.js.map +1 -0
- package/dist/{chunk-4F2ZFD5L.js → chunk-H243FWYP.js} +50 -51
- package/dist/chunk-H243FWYP.js.map +1 -0
- package/dist/{chunk-X732W3QA.js → chunk-QVYZD65U.js} +2 -2
- package/dist/{chunk-6OLNYOGU.js → chunk-XQ4UMAU7.js} +2 -2
- package/dist/{chunk-XWMTVV2D.js → chunk-YW6LFCFS.js} +5 -5
- package/dist/{chunk-IXTW3BIO.js → chunk-ZHTHUX5D.js} +3 -3
- package/dist/compat/nestjs/index.cjs +48 -49
- package/dist/compat/nestjs/index.cjs.map +1 -1
- package/dist/compat/nestjs/index.d.cts +4 -4
- package/dist/compat/nestjs/index.d.ts +4 -4
- package/dist/compat/nestjs/index.js +7 -7
- package/dist/core/index.cjs +50 -51
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +5 -5
- package/dist/extra/index.cjs +48 -49
- package/dist/extra/index.cjs.map +1 -1
- package/dist/extra/index.d.cts +4 -4
- package/dist/extra/index.d.ts +4 -4
- package/dist/extra/index.js +3 -3
- package/dist/graph/index.cjs +40 -37
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +3 -3
- package/dist/graph/index.d.ts +3 -3
- package/dist/graph/index.js +4 -4
- package/dist/{graph-DXT95WZ3.d.ts → graph-BXIK5Dq5.d.ts} +1 -1
- package/dist/{graph-BE10ujU9.d.cts → graph-BhADtuFU.d.cts} +1 -1
- package/dist/{index-QfbXNW1N.d.cts → index-BNB0KjKe.d.ts} +24 -21
- package/dist/{index-C0_7g9sj.d.ts → index-BkToATim.d.ts} +1 -1
- package/dist/{index-CiAqgfFg.d.ts → index-CKyYg4IP.d.ts} +3 -3
- package/dist/{index-CCvzN5GB.d.cts → index-DANO9Gg7.d.cts} +2 -2
- package/dist/{index-CthwPnHQ.d.cts → index-DBhLjWSV.d.cts} +3 -3
- package/dist/{index-Dzdm20sx.d.ts → index-DKIyo4Bq.d.cts} +24 -21
- package/dist/{index-53cDGX7F.d.ts → index-DSp5R3Xq.d.ts} +3 -3
- package/dist/{index-aBZ2RoP0.d.cts → index-Dqemj9q0.d.cts} +3 -3
- package/dist/{index-nRulwTr-.d.cts → index-Wa8jXne6.d.cts} +1 -1
- package/dist/{index-B10Q0sQB.d.ts → index-fYObbpUw.d.ts} +2 -2
- package/dist/index.cjs +443 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +369 -66
- package/dist/index.d.ts +369 -66
- package/dist/index.js +397 -22
- package/dist/index.js.map +1 -1
- package/dist/{meta-BcuDhtwu.d.cts → meta-CrZUQAJ6.d.cts} +1 -1
- package/dist/{meta-BcuDhtwu.d.ts → meta-CrZUQAJ6.d.ts} +1 -1
- package/dist/patterns/reactive-layout/index.cjs +53 -50
- package/dist/patterns/reactive-layout/index.cjs.map +1 -1
- package/dist/patterns/reactive-layout/index.d.cts +3 -3
- package/dist/patterns/reactive-layout/index.d.ts +3 -3
- package/dist/patterns/reactive-layout/index.js +4 -4
- package/dist/{reactive-log-OULQssZg.d.cts → reactive-log-ChbpUrY2.d.cts} +2 -2
- package/dist/{reactive-log-Cu0VdqkT.d.ts → reactive-log-DV--7BWd.d.ts} +2 -2
- package/package.json +3 -1
- package/dist/chunk-4F2ZFD5L.js.map +0 -1
- package/dist/chunk-JYRHO63K.js.map +0 -1
- /package/dist/{chunk-NULSP7U4.js.map → chunk-2ZICUAUJ.js.map} +0 -0
- /package/dist/{chunk-BRPCN2HJ.js.map → chunk-4APC3AFN.js.map} +0 -0
- /package/dist/{chunk-VQWLA6XQ.js.map → chunk-CRACCCJY.js.map} +0 -0
- /package/dist/{chunk-X732W3QA.js.map → chunk-QVYZD65U.js.map} +0 -0
- /package/dist/{chunk-6OLNYOGU.js.map → chunk-XQ4UMAU7.js.map} +0 -0
- /package/dist/{chunk-XWMTVV2D.js.map → chunk-YW6LFCFS.js.map} +0 -0
- /package/dist/{chunk-IXTW3BIO.js.map → chunk-ZHTHUX5D.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-
|
|
2
|
-
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-
|
|
1
|
+
export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-ChbpUrY2.cjs';
|
|
2
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-Dqemj9q0.cjs';
|
|
3
3
|
import 'rxjs';
|
|
4
|
-
import '../../meta-
|
|
5
|
-
import '../../graph-
|
|
4
|
+
import '../../meta-CrZUQAJ6.cjs';
|
|
5
|
+
import '../../graph-BhADtuFU.cjs';
|
|
6
6
|
import '@nestjs/common';
|
|
7
7
|
import '@nestjs/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-
|
|
2
|
-
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-
|
|
1
|
+
export { o as observeGraph$, c as observeNode$, t as toMessages$, d as toObservable } from '../../reactive-log-DV--7BWd.js';
|
|
2
|
+
export { A as ACTOR_KEY, a as ActorExtractor, C as COMMAND_HANDLERS, b as CQRS_EVENT_HANDLERS, d as CRON_HANDLERS, e as CommandHandler, f as CommandHandlerMeta, E as EVENT_HANDLERS, g as EventHandler, h as EventHandlerMeta, G as GRAPHREFLY_REQUEST_GRAPH, j as GRAPHREFLY_ROOT_GRAPH, k as GraphCron, l as GraphCronMeta, m as GraphInterval, n as GraphIntervalMeta, o as GraphReflyCqrsOptions, p as GraphReflyEventExplorer, q as GraphReflyFeatureOptions, r as GraphReflyGuard, s as GraphReflyGuardImpl, t as GraphReflyModule, u as GraphReflyRootOptions, I as INTERVAL_HANDLERS, v as InjectCqrsGraph, w as InjectGraph, x as InjectNode, O as ObserveGateway, y as ObserveGatewayOptions, z as ObserveSSEOptions, B as ObserveSubscriptionOptions, D as ObserveWsCommand, F as ObserveWsMessage, H as OnGraphEvent, J as OnGraphEventMeta, Q as QUERY_HANDLERS, K as QueryHandler, L as QueryHandlerMeta, S as SAGA_HANDLERS, M as SagaHandler, N as SagaHandlerMeta, P as fromHeader, R as fromJwtPayload, T as getActor, U as getGraphToken, V as getNodeToken, W as observeSSE, X as observeSubscription } from '../../index-DSp5R3Xq.js';
|
|
3
3
|
import 'rxjs';
|
|
4
|
-
import '../../meta-
|
|
5
|
-
import '../../graph-
|
|
4
|
+
import '../../meta-CrZUQAJ6.js';
|
|
5
|
+
import '../../graph-BXIK5Dq5.js';
|
|
6
6
|
import '@nestjs/common';
|
|
7
7
|
import '@nestjs/core';
|
|
@@ -31,19 +31,19 @@ import {
|
|
|
31
31
|
getNodeToken,
|
|
32
32
|
observeSSE,
|
|
33
33
|
observeSubscription
|
|
34
|
-
} from "../../chunk-
|
|
35
|
-
import "../../chunk-XWMTVV2D.js";
|
|
36
|
-
import "../../chunk-IXTW3BIO.js";
|
|
34
|
+
} from "../../chunk-2ZICUAUJ.js";
|
|
37
35
|
import {
|
|
38
36
|
observeGraph$,
|
|
39
37
|
observeNode$,
|
|
40
38
|
toMessages$,
|
|
41
39
|
toObservable
|
|
42
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-QVYZD65U.js";
|
|
41
|
+
import "../../chunk-ZHTHUX5D.js";
|
|
42
|
+
import "../../chunk-YW6LFCFS.js";
|
|
43
43
|
import "../../chunk-WZ2Z2CRV.js";
|
|
44
|
-
import "../../chunk-
|
|
45
|
-
import "../../chunk-
|
|
46
|
-
import "../../chunk-
|
|
44
|
+
import "../../chunk-CRACCCJY.js";
|
|
45
|
+
import "../../chunk-XQ4UMAU7.js";
|
|
46
|
+
import "../../chunk-H243FWYP.js";
|
|
47
47
|
export {
|
|
48
48
|
ACTOR_KEY,
|
|
49
49
|
COMMAND_HANDLERS,
|
package/dist/core/index.cjs
CHANGED
|
@@ -44,9 +44,9 @@ __export(core_exports, {
|
|
|
44
44
|
defaultHash: () => defaultHash,
|
|
45
45
|
derived: () => derived,
|
|
46
46
|
describeNode: () => describeNode,
|
|
47
|
+
downWithBatch: () => downWithBatch,
|
|
47
48
|
dynamicNode: () => dynamicNode,
|
|
48
49
|
effect: () => effect,
|
|
49
|
-
emitWithBatch: () => emitWithBatch,
|
|
50
50
|
isBatching: () => isBatching,
|
|
51
51
|
isKnownMessageType: () => isKnownMessageType,
|
|
52
52
|
isPhase2Message: () => isPhase2Message,
|
|
@@ -161,8 +161,7 @@ function drainPending() {
|
|
|
161
161
|
if (ownsFlush) {
|
|
162
162
|
flushInProgress = true;
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
let hasError = false;
|
|
164
|
+
const errors = [];
|
|
166
165
|
try {
|
|
167
166
|
let iterations = 0;
|
|
168
167
|
while (pendingPhase2.length > 0 || pendingPhase3.length > 0) {
|
|
@@ -180,10 +179,7 @@ function drainPending() {
|
|
|
180
179
|
try {
|
|
181
180
|
run();
|
|
182
181
|
} catch (e) {
|
|
183
|
-
|
|
184
|
-
firstError = e;
|
|
185
|
-
hasError = true;
|
|
186
|
-
}
|
|
182
|
+
errors.push(e);
|
|
187
183
|
}
|
|
188
184
|
}
|
|
189
185
|
}
|
|
@@ -201,10 +197,7 @@ function drainPending() {
|
|
|
201
197
|
try {
|
|
202
198
|
run();
|
|
203
199
|
} catch (e) {
|
|
204
|
-
|
|
205
|
-
firstError = e;
|
|
206
|
-
hasError = true;
|
|
207
|
-
}
|
|
200
|
+
errors.push(e);
|
|
208
201
|
}
|
|
209
202
|
}
|
|
210
203
|
}
|
|
@@ -214,8 +207,11 @@ function drainPending() {
|
|
|
214
207
|
flushInProgress = false;
|
|
215
208
|
}
|
|
216
209
|
}
|
|
217
|
-
if (
|
|
218
|
-
throw
|
|
210
|
+
if (errors.length === 1) {
|
|
211
|
+
throw errors[0];
|
|
212
|
+
}
|
|
213
|
+
if (errors.length > 1) {
|
|
214
|
+
throw new AggregateError(errors, "batch drain: multiple callbacks threw");
|
|
219
215
|
}
|
|
220
216
|
}
|
|
221
217
|
function partitionForBatch(messages) {
|
|
@@ -233,12 +229,12 @@ function partitionForBatch(messages) {
|
|
|
233
229
|
}
|
|
234
230
|
return { immediate, deferred, terminal };
|
|
235
231
|
}
|
|
236
|
-
function
|
|
232
|
+
function downWithBatch(sink, messages, phase = 2, options) {
|
|
237
233
|
if (messages.length === 0) {
|
|
238
234
|
return;
|
|
239
235
|
}
|
|
240
236
|
if (options?.strategy === "sequential") {
|
|
241
|
-
|
|
237
|
+
_downSequential(sink, messages, phase);
|
|
242
238
|
return;
|
|
243
239
|
}
|
|
244
240
|
const queue = phase === 3 ? pendingPhase3 : pendingPhase2;
|
|
@@ -246,61 +242,61 @@ function emitWithBatch(emit, messages, phase = 2, options) {
|
|
|
246
242
|
const t = messages[0][0];
|
|
247
243
|
if (t === DATA || t === RESOLVED) {
|
|
248
244
|
if (isBatching()) {
|
|
249
|
-
queue.push(() =>
|
|
245
|
+
queue.push(() => sink(messages));
|
|
250
246
|
} else {
|
|
251
|
-
|
|
247
|
+
sink(messages);
|
|
252
248
|
}
|
|
253
249
|
} else if (isTerminalMessage(t)) {
|
|
254
250
|
if (isBatching()) {
|
|
255
|
-
queue.push(() =>
|
|
251
|
+
queue.push(() => sink(messages));
|
|
256
252
|
} else {
|
|
257
|
-
|
|
253
|
+
sink(messages);
|
|
258
254
|
}
|
|
259
255
|
} else {
|
|
260
|
-
|
|
256
|
+
sink(messages);
|
|
261
257
|
}
|
|
262
258
|
return;
|
|
263
259
|
}
|
|
264
260
|
const { immediate, deferred, terminal } = partitionForBatch(messages);
|
|
265
261
|
if (immediate.length > 0) {
|
|
266
|
-
|
|
262
|
+
sink(immediate);
|
|
267
263
|
}
|
|
268
264
|
if (isBatching()) {
|
|
269
265
|
if (deferred.length > 0) {
|
|
270
|
-
queue.push(() =>
|
|
266
|
+
queue.push(() => sink(deferred));
|
|
271
267
|
}
|
|
272
268
|
if (terminal.length > 0) {
|
|
273
|
-
queue.push(() =>
|
|
269
|
+
queue.push(() => sink(terminal));
|
|
274
270
|
}
|
|
275
271
|
} else {
|
|
276
272
|
if (deferred.length > 0) {
|
|
277
|
-
|
|
273
|
+
sink(deferred);
|
|
278
274
|
}
|
|
279
275
|
if (terminal.length > 0) {
|
|
280
|
-
|
|
276
|
+
sink(terminal);
|
|
281
277
|
}
|
|
282
278
|
}
|
|
283
279
|
}
|
|
284
|
-
function
|
|
280
|
+
function _downSequential(sink, messages, phase = 2) {
|
|
285
281
|
const dataQueue = phase === 3 ? pendingPhase3 : pendingPhase2;
|
|
286
282
|
for (const msg of messages) {
|
|
287
283
|
const tier = messageTier(msg[0]);
|
|
288
284
|
if (tier === 2) {
|
|
289
285
|
if (isBatching()) {
|
|
290
286
|
const m = msg;
|
|
291
|
-
dataQueue.push(() =>
|
|
287
|
+
dataQueue.push(() => sink([m]));
|
|
292
288
|
} else {
|
|
293
|
-
|
|
289
|
+
sink([msg]);
|
|
294
290
|
}
|
|
295
291
|
} else if (tier >= 3) {
|
|
296
292
|
if (isBatching()) {
|
|
297
293
|
const m = msg;
|
|
298
|
-
pendingPhase3.push(() =>
|
|
294
|
+
pendingPhase3.push(() => sink([m]));
|
|
299
295
|
} else {
|
|
300
|
-
|
|
296
|
+
sink([msg]);
|
|
301
297
|
}
|
|
302
298
|
} else {
|
|
303
|
-
|
|
299
|
+
sink([msg]);
|
|
304
300
|
}
|
|
305
301
|
}
|
|
306
302
|
}
|
|
@@ -588,7 +584,7 @@ var NodeImpl = class {
|
|
|
588
584
|
_singleDepSinks = /* @__PURE__ */ new WeakSet();
|
|
589
585
|
_upstreamUnsubs = [];
|
|
590
586
|
_actions;
|
|
591
|
-
|
|
587
|
+
_boundDownToSinks;
|
|
592
588
|
_inspectorHook;
|
|
593
589
|
_versioning;
|
|
594
590
|
_hashFn;
|
|
@@ -635,7 +631,7 @@ var NodeImpl = class {
|
|
|
635
631
|
},
|
|
636
632
|
emit(value) {
|
|
637
633
|
self._manualEmitUsed = true;
|
|
638
|
-
self.
|
|
634
|
+
self._downAutoValue(value);
|
|
639
635
|
},
|
|
640
636
|
up(messages) {
|
|
641
637
|
self._upInternal(messages);
|
|
@@ -643,7 +639,7 @@ var NodeImpl = class {
|
|
|
643
639
|
};
|
|
644
640
|
this.down = this.down.bind(this);
|
|
645
641
|
this.up = this.up.bind(this);
|
|
646
|
-
this.
|
|
642
|
+
this._boundDownToSinks = this._downToSinks.bind(this);
|
|
647
643
|
}
|
|
648
644
|
get name() {
|
|
649
645
|
return this._registryName ?? this._optsName;
|
|
@@ -749,12 +745,12 @@ var NodeImpl = class {
|
|
|
749
745
|
if (sinkMessages[i][0] !== DIRTY) filtered.push(sinkMessages[i]);
|
|
750
746
|
}
|
|
751
747
|
if (filtered.length > 0) {
|
|
752
|
-
|
|
748
|
+
downWithBatch(this._boundDownToSinks, filtered);
|
|
753
749
|
}
|
|
754
750
|
return;
|
|
755
751
|
}
|
|
756
752
|
}
|
|
757
|
-
|
|
753
|
+
downWithBatch(this._boundDownToSinks, sinkMessages);
|
|
758
754
|
}
|
|
759
755
|
subscribe(sink, hints) {
|
|
760
756
|
if (hints?.actor != null && this._guard != null) {
|
|
@@ -841,7 +837,7 @@ var NodeImpl = class {
|
|
|
841
837
|
this._disconnectUpstream();
|
|
842
838
|
}
|
|
843
839
|
// --- Private methods (prototype, _ prefix) ---
|
|
844
|
-
|
|
840
|
+
_downToSinks(messages) {
|
|
845
841
|
if (this._sinks == null) return;
|
|
846
842
|
if (typeof this._sinks === "function") {
|
|
847
843
|
this._sinks(messages);
|
|
@@ -856,6 +852,9 @@ var NodeImpl = class {
|
|
|
856
852
|
for (const m of messages) {
|
|
857
853
|
const t = m[0];
|
|
858
854
|
if (t === DATA) {
|
|
855
|
+
if (m.length < 2) {
|
|
856
|
+
continue;
|
|
857
|
+
}
|
|
859
858
|
this._cached = m[1];
|
|
860
859
|
if (this._versioning != null) {
|
|
861
860
|
advanceVersion(this._versioning, m[1], this._hashFn);
|
|
@@ -903,7 +902,7 @@ var NodeImpl = class {
|
|
|
903
902
|
_canSkipDirty() {
|
|
904
903
|
return this._sinkCount === 1 && this._singleDepSinkCount === 1;
|
|
905
904
|
}
|
|
906
|
-
|
|
905
|
+
_downAutoValue(value) {
|
|
907
906
|
const wasDirty = this._status === "dirty";
|
|
908
907
|
let unchanged;
|
|
909
908
|
try {
|
|
@@ -956,7 +955,7 @@ var NodeImpl = class {
|
|
|
956
955
|
this._cleanup = out.cleanup;
|
|
957
956
|
if (this._manualEmitUsed) return;
|
|
958
957
|
if ("value" in out) {
|
|
959
|
-
this.
|
|
958
|
+
this._downAutoValue(out.value);
|
|
960
959
|
}
|
|
961
960
|
return;
|
|
962
961
|
}
|
|
@@ -966,7 +965,7 @@ var NodeImpl = class {
|
|
|
966
965
|
}
|
|
967
966
|
if (this._manualEmitUsed) return;
|
|
968
967
|
if (out === void 0) return;
|
|
969
|
-
this.
|
|
968
|
+
this._downAutoValue(out);
|
|
970
969
|
} catch (err) {
|
|
971
970
|
const errMsg = err instanceof Error ? err.message : String(err);
|
|
972
971
|
const wrapped = new Error(`Node "${this.name}": fn threw: ${errMsg}`, { cause: err });
|
|
@@ -1194,7 +1193,7 @@ var DynamicNodeImpl = class {
|
|
|
1194
1193
|
_singleDepSinks = /* @__PURE__ */ new WeakSet();
|
|
1195
1194
|
// Actions object (for onMessage handler)
|
|
1196
1195
|
_actions;
|
|
1197
|
-
|
|
1196
|
+
_boundDownToSinks;
|
|
1198
1197
|
// Mutable state
|
|
1199
1198
|
_cached = NO_VALUE;
|
|
1200
1199
|
_status = "disconnected";
|
|
@@ -1241,7 +1240,7 @@ var DynamicNodeImpl = class {
|
|
|
1241
1240
|
self._downInternal(messages);
|
|
1242
1241
|
},
|
|
1243
1242
|
emit(value) {
|
|
1244
|
-
self.
|
|
1243
|
+
self._downAutoValue(value);
|
|
1245
1244
|
},
|
|
1246
1245
|
up(messages) {
|
|
1247
1246
|
for (const dep of self._deps) {
|
|
@@ -1249,7 +1248,7 @@ var DynamicNodeImpl = class {
|
|
|
1249
1248
|
}
|
|
1250
1249
|
}
|
|
1251
1250
|
};
|
|
1252
|
-
this.
|
|
1251
|
+
this._boundDownToSinks = this._downToSinks.bind(this);
|
|
1253
1252
|
}
|
|
1254
1253
|
get name() {
|
|
1255
1254
|
return this._registryName ?? this._optsName;
|
|
@@ -1329,12 +1328,12 @@ var DynamicNodeImpl = class {
|
|
|
1329
1328
|
if (sinkMessages[i][0] !== DIRTY) filtered.push(sinkMessages[i]);
|
|
1330
1329
|
}
|
|
1331
1330
|
if (filtered.length > 0) {
|
|
1332
|
-
|
|
1331
|
+
downWithBatch(this._boundDownToSinks, filtered);
|
|
1333
1332
|
}
|
|
1334
1333
|
return;
|
|
1335
1334
|
}
|
|
1336
1335
|
}
|
|
1337
|
-
|
|
1336
|
+
downWithBatch(this._boundDownToSinks, sinkMessages);
|
|
1338
1337
|
}
|
|
1339
1338
|
_canSkipDirty() {
|
|
1340
1339
|
return this._sinkCount === 1 && this._singleDepSinkCount === 1;
|
|
@@ -1410,7 +1409,7 @@ var DynamicNodeImpl = class {
|
|
|
1410
1409
|
this._disconnect();
|
|
1411
1410
|
}
|
|
1412
1411
|
// --- Private methods ---
|
|
1413
|
-
|
|
1412
|
+
_downToSinks(messages) {
|
|
1414
1413
|
if (this._sinks == null) return;
|
|
1415
1414
|
if (typeof this._sinks === "function") {
|
|
1416
1415
|
this._sinks(messages);
|
|
@@ -1464,7 +1463,7 @@ var DynamicNodeImpl = class {
|
|
|
1464
1463
|
}
|
|
1465
1464
|
}
|
|
1466
1465
|
}
|
|
1467
|
-
|
|
1466
|
+
_downAutoValue(value) {
|
|
1468
1467
|
const wasDirty = this._status === "dirty";
|
|
1469
1468
|
let unchanged;
|
|
1470
1469
|
try {
|
|
@@ -1524,7 +1523,7 @@ var DynamicNodeImpl = class {
|
|
|
1524
1523
|
const result = this._fn(get);
|
|
1525
1524
|
this._rewire(trackedDeps);
|
|
1526
1525
|
if (result === void 0) return;
|
|
1527
|
-
this.
|
|
1526
|
+
this._downAutoValue(result);
|
|
1528
1527
|
} catch (err) {
|
|
1529
1528
|
this._downInternal([[ERROR, err]]);
|
|
1530
1529
|
}
|
|
@@ -1588,14 +1587,14 @@ var DynamicNodeImpl = class {
|
|
|
1588
1587
|
this._dirtyBits.add(index);
|
|
1589
1588
|
this._settledBits.delete(index);
|
|
1590
1589
|
if (this._dirtyBits.size === 1) {
|
|
1591
|
-
|
|
1590
|
+
downWithBatch(this._boundDownToSinks, [[DIRTY]]);
|
|
1592
1591
|
}
|
|
1593
1592
|
continue;
|
|
1594
1593
|
}
|
|
1595
1594
|
if (t === DATA || t === RESOLVED) {
|
|
1596
1595
|
if (!this._dirtyBits.has(index)) {
|
|
1597
1596
|
this._dirtyBits.add(index);
|
|
1598
|
-
|
|
1597
|
+
downWithBatch(this._boundDownToSinks, [[DIRTY]]);
|
|
1599
1598
|
}
|
|
1600
1599
|
this._settledBits.add(index);
|
|
1601
1600
|
if (this._allDirtySettled()) {
|
|
@@ -1806,9 +1805,9 @@ var ResettableTimer = class {
|
|
|
1806
1805
|
defaultHash,
|
|
1807
1806
|
derived,
|
|
1808
1807
|
describeNode,
|
|
1808
|
+
downWithBatch,
|
|
1809
1809
|
dynamicNode,
|
|
1810
1810
|
effect,
|
|
1811
|
-
emitWithBatch,
|
|
1812
1811
|
isBatching,
|
|
1813
1812
|
isKnownMessageType,
|
|
1814
1813
|
isPhase2Message,
|