@pyreon/reactivity 0.5.6 → 0.5.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.
@@ -1,884 +1,356 @@
1
- function batch(fn) {
2
- batchDepth++;
3
- try {
4
- fn();
5
- } finally {
6
- batchDepth--;
7
- if (batchDepth === 0 && pendingNotifications.size > 0) {
8
- const flush = pendingNotifications;
9
- pendingNotifications = flush === setA ? setB : setA;
10
- for (const notify of flush) notify();
11
- flush.clear();
12
- }
13
- }
14
- }
15
- function isBatching() {
16
- return batchDepth > 0;
17
- }
18
- function enqueuePendingNotification(notify) {
19
- pendingNotifications.add(notify);
20
- }
1
+ //#region src/batch.d.ts
2
+ declare function batch(fn: () => void): void;
21
3
  /**
22
- * Returns a Promise that resolves after all currently-pending microtasks have flushed.
23
- * Useful when you need to read the DOM after a batch of signal updates has settled.
24
- *
25
- * @example
26
- * count.set(1); count.set(2)
27
- * await nextTick()
28
- * // DOM is now up-to-date
29
- */
30
- function nextTick() {
31
- return new Promise(resolve => queueMicrotask(resolve));
32
- }
33
-
4
+ * Returns a Promise that resolves after all currently-pending microtasks have flushed.
5
+ * Useful when you need to read the DOM after a batch of signal updates has settled.
6
+ *
7
+ * @example
8
+ * count.set(1); count.set(2)
9
+ * await nextTick()
10
+ * // DOM is now up-to-date
11
+ */
12
+ declare function nextTick(): Promise<void>;
34
13
  //#endregion
35
- //#region src/cell.ts
14
+ //#region src/cell.d.ts
36
15
  /**
37
- * Lightweight reactive cell — class-based alternative to signal().
38
- *
39
- * - 1 object allocation vs signal()'s 6 closures
40
- * - Same API surface: peek(), set(), update(), subscribe(), listen()
41
- * - NOT callable as a getter (no effect tracking) — use for fixed subscriptions
42
- * - Methods on prototype, shared across all instances
43
- * - Single-listener fast path: no Set allocated when ≤1 subscriber
44
- *
45
- * Use when you need reactive state but don't need automatic effect dependency tracking.
46
- * Ideal for list item labels in keyed reconcilers where subscribe() is used directly.
47
- */
48
-
49
- function cell(value) {
50
- return new Cell(value);
51
- }
52
-
16
+ * Lightweight reactive cell — class-based alternative to signal().
17
+ *
18
+ * - 1 object allocation vs signal()'s 6 closures
19
+ * - Same API surface: peek(), set(), update(), subscribe(), listen()
20
+ * - NOT callable as a getter (no effect tracking) — use for fixed subscriptions
21
+ * - Methods on prototype, shared across all instances
22
+ * - Single-listener fast path: no Set allocated when ≤1 subscriber
23
+ *
24
+ * Use when you need reactive state but don't need automatic effect dependency tracking.
25
+ * Ideal for list item labels in keyed reconcilers where subscribe() is used directly.
26
+ */
27
+ declare class Cell<T> {
28
+ /** @internal */
29
+ _v: T;
30
+ /** @internal */
31
+ _l: (() => void) | null;
32
+ /** @internal */
33
+ _s: Set<() => void> | null;
34
+ constructor(value: T);
35
+ peek(): T;
36
+ set(value: T): void;
37
+ update(fn: (current: T) => T): void;
38
+ /**
39
+ * Fire-and-forget subscription — no unsubscribe returned.
40
+ * Use when the listener's lifetime matches the cell's (e.g., list rows).
41
+ * Saves 1 closure allocation per call vs subscribe().
42
+ */
43
+ listen(listener: () => void): void;
44
+ subscribe(listener: () => void): () => void;
45
+ }
46
+ declare function cell<T>(value: T): Cell<T>;
53
47
  //#endregion
54
- //#region src/scope.ts
55
-
56
- function getCurrentScope() {
57
- return _currentScope;
58
- }
59
- function setCurrentScope(scope) {
60
- _currentScope = scope;
61
- }
62
- /** Create a new EffectScope. */
63
- function effectScope() {
64
- return new EffectScope();
65
- }
66
-
48
+ //#region src/computed.d.ts
49
+ interface Computed<T> {
50
+ (): T;
51
+ /** Remove this computed from all its reactive dependencies. */
52
+ dispose(): void;
53
+ }
54
+ interface ComputedOptions<T> {
55
+ /**
56
+ * Custom equality function. When provided, the computed eagerly re-evaluates
57
+ * on dependency change and only notifies downstream if `equals(prev, next)`
58
+ * returns false. Useful for derived objects/arrays to skip spurious updates.
59
+ *
60
+ * @example
61
+ * const sorted = computed(() => items().slice().sort(), {
62
+ * equals: (a, b) => a.length === b.length && a.every((v, i) => v === b[i])
63
+ * })
64
+ */
65
+ equals?: (prev: T, next: T) => boolean;
66
+ }
67
+ declare function computed<T>(fn: () => T, options?: ComputedOptions<T>): Computed<T>;
67
68
  //#endregion
68
- //#region src/tracking.ts
69
-
70
- function setDepsCollector(collector) {
71
- _depsCollector = collector;
72
- }
73
- function setSkipDepsCollection(skip) {
74
- _skipDepsCollection = skip;
75
- }
69
+ //#region src/createSelector.d.ts
76
70
  /**
77
- * Register the active effect as a subscriber of the given reactive source.
78
- * The subscriber Set is created lazily on the host sources read only outside
79
- * effects never allocate a Set.
80
- */
81
- function trackSubscriber(host) {
82
- if (activeEffect) {
83
- if (!host._s) host._s = /* @__PURE__ */new Set();
84
- host._s.add(activeEffect);
85
- if (_skipDepsCollection) return;
86
- if (_depsCollector) _depsCollector.push(host._s);else {
87
- let deps = effectDeps.get(activeEffect);
88
- if (!deps) {
89
- deps = /* @__PURE__ */new Set();
90
- effectDeps.set(activeEffect, deps);
91
- }
92
- deps.add(host._s);
93
- }
94
- }
95
- }
96
- /**
97
- * Remove an effect from every subscriber set it was registered in,
98
- * then clear its dep record. Call this before each re-run and on dispose.
99
- */
100
- function cleanupEffect(fn) {
101
- const deps = effectDeps.get(fn);
102
- if (deps) {
103
- for (const sub of deps) sub.delete(fn);
104
- deps.clear();
105
- }
106
- }
107
- function notifySubscribers(subscribers) {
108
- if (subscribers.size === 0) return;
109
- if (subscribers.size === 1) {
110
- const sub = subscribers.values().next().value;
111
- if (isBatching()) enqueuePendingNotification(sub);else sub();
112
- return;
113
- }
114
- if (isBatching()) for (const sub of subscribers) enqueuePendingNotification(sub);else {
115
- const originalSize = subscribers.size;
116
- let i = 0;
117
- for (const sub of subscribers) {
118
- if (i >= originalSize) break;
119
- sub();
120
- i++;
121
- }
122
- }
123
- }
124
- function withTracking(fn, compute) {
125
- const prev = activeEffect;
126
- activeEffect = fn;
127
- try {
128
- return compute();
129
- } finally {
130
- activeEffect = prev;
131
- }
132
- }
133
- function _setActiveEffect(fn) {
134
- _prevEffect = activeEffect;
135
- activeEffect = fn;
136
- }
137
- function _restoreActiveEffect() {
138
- activeEffect = _prevEffect;
139
- _prevEffect = null;
140
- }
141
- function runUntracked(fn) {
142
- const prev = activeEffect;
143
- activeEffect = null;
144
- try {
145
- return fn();
146
- } finally {
147
- activeEffect = prev;
148
- }
149
- }
150
-
71
+ * Create an equality selector returns a reactive predicate that is true
72
+ * only for the currently selected value.
73
+ *
74
+ * Unlike a plain `() => source() === value`, this only triggers the TWO
75
+ * affected subscribers (deselected + newly selected) instead of ALL
76
+ * subscribers, making selection O(1) regardless of list size.
77
+ *
78
+ * @example
79
+ * const isSelected = createSelector(selectedId)
80
+ * // In each row:
81
+ * class: () => (isSelected(row.id) ? "selected" : "")
82
+ */
83
+ declare function createSelector<T>(source: () => T): (value: T) => boolean;
151
84
  //#endregion
152
- //#region src/computed.ts
153
- /** Remove a computed from all dependency subscriber sets (local deps array). */
154
- function cleanupLocalDeps$1(deps, fn) {
155
- for (let i = 0; i < deps.length; i++) deps[i].delete(fn);
156
- deps.length = 0;
157
- }
158
- /** Re-track dependencies using the local deps array collector. */
159
- function trackWithLocalDeps(deps, effect, fn) {
160
- setDepsCollector(deps);
161
- const result = withTracking(effect, fn);
162
- setDepsCollector(null);
163
- return result;
164
- }
165
- function computed(fn, options) {
166
- return options?.equals ? computedWithEquals(fn, options.equals) : computedLazy(fn);
85
+ //#region src/signal.d.ts
86
+ interface SignalDebugInfo<T> {
87
+ /** Signal name (set via options or inferred) */
88
+ name: string | undefined;
89
+ /** Current value (same as peek()) */
90
+ value: T;
91
+ /** Number of active subscribers */
92
+ subscriberCount: number;
167
93
  }
168
94
  /**
169
- * Default computedlazy evaluation with deferred cleanup.
170
- *
171
- * On notification: just marks dirty and propagates (no cleanup/re-track).
172
- * On read: cleans up old deps, re-evaluates, re-tracks.
173
- *
174
- * The `if (dirty) return` early exit in recompute prevents double-propagation
175
- * in diamond patterns (a→b,c→d: b notifies d, c tries to notify d again —
176
- * skipped because d is already dirty).
177
- */
178
- function computedLazy(fn) {
179
- let value;
180
- let dirty = true;
181
- let disposed = false;
182
- let tracked = false;
183
- const deps = [];
184
- const host = {
185
- _s: null
186
- };
187
- const recompute = () => {
188
- if (disposed || dirty) return;
189
- dirty = true;
190
- if (host._s) notifySubscribers(host._s);
191
- };
192
- const read = () => {
193
- trackSubscriber(host);
194
- if (dirty) {
195
- if (tracked) {
196
- setSkipDepsCollection(true);
197
- value = withTracking(recompute, fn);
198
- setSkipDepsCollection(false);
199
- } else {
200
- value = trackWithLocalDeps(deps, recompute, fn);
201
- tracked = true;
202
- }
203
- dirty = false;
204
- }
205
- return value;
206
- };
207
- read.dispose = () => {
208
- disposed = true;
209
- cleanupLocalDeps$1(deps, recompute);
210
- };
211
- getCurrentScope()?.add({
212
- dispose: read.dispose
213
- });
214
- return read;
95
+ * Read-only reactive value the common interface that both Signal and Computed satisfy.
96
+ * Use this as the parameter type when a function only needs to read a reactive value.
97
+ */
98
+ interface ReadonlySignal<T> {
99
+ (): T;
100
+ }
101
+ interface Signal<T> {
102
+ (): T;
103
+ /** Read the current value WITHOUT registering a reactive dependency. */
104
+ peek(): T;
105
+ set(value: T): void;
106
+ update(fn: (current: T) => T): void;
107
+ /**
108
+ * Subscribe a static listener directly — no effect overhead (no withTracking,
109
+ * no cleanupEffect, no effectDeps WeakMap). Use when the dependency is fixed
110
+ * and dynamic re-tracking is not needed.
111
+ * Returns a disposer that removes the subscription.
112
+ */
113
+ subscribe(listener: () => void): () => void;
114
+ /**
115
+ * Register a direct updater — even lighter than subscribe().
116
+ * Uses a flat array instead of Set. Disposal nulls the slot (no Set.delete).
117
+ * Intended for compiler-emitted DOM bindings (_bindText, _bindDirect).
118
+ * Returns a disposer that nulls the slot.
119
+ */
120
+ direct(updater: () => void): () => void;
121
+ /** Debug name — useful for devtools and logging. */
122
+ label: string | undefined;
123
+ /** Returns a snapshot of the signal's debug info (value, name, subscriber count). */
124
+ debug(): SignalDebugInfo<T>;
125
+ }
126
+ interface SignalOptions {
127
+ /** Debug name for this signal — shows up in devtools and debug() output. */
128
+ name?: string;
215
129
  }
216
130
  /**
217
- * Computed with custom equality — eager evaluation on notification.
218
- *
219
- * Re-evaluates immediately when deps change and only notifies downstream
220
- * if `equals(prev, next)` returns false.
221
- */
222
- function computedWithEquals(fn, equals) {
223
- let value;
224
- let dirty = true;
225
- let initialized = false;
226
- let disposed = false;
227
- const deps = [];
228
- const host = {
229
- _s: null
230
- };
231
- const recompute = () => {
232
- if (disposed) return;
233
- cleanupLocalDeps$1(deps, recompute);
234
- const next = trackWithLocalDeps(deps, recompute, fn);
235
- if (initialized && equals(value, next)) return;
236
- value = next;
237
- dirty = false;
238
- initialized = true;
239
- if (host._s) notifySubscribers(host._s);
240
- };
241
- const read = () => {
242
- trackSubscriber(host);
243
- if (dirty) {
244
- cleanupLocalDeps$1(deps, recompute);
245
- value = trackWithLocalDeps(deps, recompute, fn);
246
- dirty = false;
247
- initialized = true;
248
- }
249
- return value;
250
- };
251
- read.dispose = () => {
252
- disposed = true;
253
- cleanupLocalDeps$1(deps, recompute);
254
- cleanupEffect(recompute);
255
- };
256
- getCurrentScope()?.add({
257
- dispose: read.dispose
258
- });
259
- return read;
260
- }
261
-
131
+ * Create a reactive signal.
132
+ *
133
+ * Only 1 closure is allocated (the read function). State is stored as
134
+ * properties on the function object (_v, _s) and methods (peek, set,
135
+ * update, subscribe) are shared across all signals — not per-signal closures.
136
+ */
137
+ declare function signal<T>(initialValue: T, options?: SignalOptions): Signal<T>;
262
138
  //#endregion
263
- //#region src/effect.ts
264
-
265
- function setErrorHandler(fn) {
266
- _errorHandler = fn;
267
- }
268
- /** Remove an effect from all dependency subscriber sets (local deps array). */
269
- function cleanupLocalDeps(deps, fn) {
270
- if (deps.length === 1) {
271
- deps[0].delete(fn);
272
- deps.length = 0;
273
- } else if (deps.length > 1) {
274
- for (let i = 0; i < deps.length; i++) deps[i].delete(fn);
275
- deps.length = 0;
276
- }
277
- }
278
- function effect(fn) {
279
- const scope = getCurrentScope();
280
- let disposed = false;
281
- let isFirstRun = true;
282
- let cleanup;
283
- const deps = [];
284
- const runCleanup = () => {
285
- if (typeof cleanup === "function") {
286
- try {
287
- cleanup();
288
- } catch (err) {
289
- _errorHandler(err);
290
- }
291
- cleanup = void 0;
292
- }
293
- };
294
- const run = () => {
295
- if (disposed) return;
296
- runCleanup();
297
- try {
298
- cleanupLocalDeps(deps, run);
299
- setDepsCollector(deps);
300
- cleanup = withTracking(run, fn) || void 0;
301
- setDepsCollector(null);
302
- } catch (err) {
303
- setDepsCollector(null);
304
- _errorHandler(err);
305
- }
306
- if (!isFirstRun) scope?.notifyEffectRan();
307
- isFirstRun = false;
308
- };
309
- run();
310
- const e = {
311
- dispose() {
312
- runCleanup();
313
- disposed = true;
314
- cleanupLocalDeps(deps, run);
315
- }
316
- };
317
- getCurrentScope()?.add(e);
318
- return e;
319
- }
139
+ //#region src/debug.d.ts
140
+ interface SignalUpdateEvent {
141
+ /** The signal that changed */
142
+ signal: Signal<unknown>;
143
+ /** Signal name (from options or label) */
144
+ name: string | undefined;
145
+ /** Previous value */
146
+ prev: unknown;
147
+ /** New value */
148
+ next: unknown;
149
+ /** Stack trace at the point of the .set() / .update() call */
150
+ stack: string;
151
+ /** Timestamp */
152
+ timestamp: number;
153
+ }
154
+ type SignalUpdateListener = (event: SignalUpdateEvent) => void;
320
155
  /**
321
- * Lightweight effect for DOM render bindings.
322
- *
323
- * Differences from `effect()`:
324
- * - No EffectScope registration (caller owns the dispose lifecycle)
325
- * - No error handler (errors propagate naturally)
326
- * - No onUpdate notification
327
- * - Deps stored in a local array instead of the global WeakMap — faster
328
- * creation and disposal (~200ns saved per effect vs WeakMap path)
329
- *
330
- * Returns a dispose function (not an Effect object — saves 1 allocation).
331
- */
156
+ * Register a listener that fires on every signal write.
157
+ * Returns a dispose function.
158
+ *
159
+ * @example
160
+ * const dispose = onSignalUpdate(e => {
161
+ * console.log(`${e.name ?? 'anonymous'}: ${e.prev} → ${e.next}`)
162
+ * })
163
+ */
164
+ declare function onSignalUpdate(listener: SignalUpdateListener): () => void;
332
165
  /**
333
- * Static-dep binding compiler helper for template expressions.
334
- *
335
- * Like renderEffect but assumes dependencies never change (true for all
336
- * compiler-emitted template bindings like `_tpl()` text/attribute updates).
337
- *
338
- * Tracks dependencies only on the first run. Re-runs skip cleanup, re-tracking,
339
- * and tracking context save/restore entirely just calls `fn()` directly.
340
- *
341
- * Per re-run savings vs renderEffect:
342
- * - No deps iteration + Set.delete (cleanup)
343
- * - No setDepsCollector + withTracking (re-registration)
344
- * - Signal reads hit `if (activeEffect)` null check → instant return
345
- */
346
- function _bind(fn) {
347
- const deps = [];
348
- let disposed = false;
349
- const run = () => {
350
- if (disposed) return;
351
- fn();
352
- };
353
- setDepsCollector(deps);
354
- withTracking(run, fn);
355
- setDepsCollector(null);
356
- const dispose = () => {
357
- if (disposed) return;
358
- disposed = true;
359
- for (const s of deps) s.delete(run);
360
- deps.length = 0;
361
- };
362
- getCurrentScope()?.add({
363
- dispose
364
- });
365
- return dispose;
366
- }
367
- /** Full re-track path for renderEffect: cleanup old deps, evaluate with tracking. */
368
- function renderEffectFullTrack(deps, run, fn) {
369
- if (deps.length === 1) {
370
- deps[0].delete(run);
371
- deps.length = 0;
372
- } else if (deps.length > 1) {
373
- for (const s of deps) s.delete(run);
374
- deps.length = 0;
375
- }
376
- setDepsCollector(deps);
377
- _setActiveEffect(run);
378
- try {
379
- fn();
380
- } finally {
381
- _restoreActiveEffect();
382
- setDepsCollector(null);
383
- }
384
- }
385
- function renderEffect(fn) {
386
- const deps = [];
387
- let disposed = false;
388
- const run = () => {
389
- if (disposed) return;
390
- renderEffectFullTrack(deps, run, fn);
391
- };
392
- run();
393
- const dispose = () => {
394
- if (disposed) return;
395
- disposed = true;
396
- if (deps.length === 1) deps[0].delete(run);else for (const s of deps) s.delete(run);
397
- deps.length = 0;
398
- };
399
- getCurrentScope()?.add({
400
- dispose
401
- });
402
- return dispose;
403
- }
404
-
405
- //#endregion
406
- //#region src/createSelector.ts
166
+ * Trace the next signal update. Logs which signals fire and what changed.
167
+ * Call before triggering a state change to see what updates and why.
168
+ *
169
+ * @example
170
+ * why()
171
+ * count.set(5)
172
+ * // Console: [pyreon:why] "count": 3 5 (2 subscribers)
173
+ */
174
+ declare function why(): void;
407
175
  /**
408
- * Notify a subscriber bucket without snapshot allocation.
409
- * Caps iteration at the original size to avoid infinite loops from
410
- * re-inserted entries (same pattern as notifySubscribers in tracking.ts).
411
- */
412
- function notifyBucket(bucket) {
413
- if (bucket.size === 0) return;
414
- if (bucket.size === 1) {
415
- bucket.values().next().value();
416
- return;
417
- }
418
- const originalSize = bucket.size;
419
- let i = 0;
420
- for (const fn of bucket) {
421
- if (i >= originalSize) break;
422
- fn();
423
- i++;
424
- }
425
- }
426
- /**
427
- * Create an equality selector — returns a reactive predicate that is true
428
- * only for the currently selected value.
429
- *
430
- * Unlike a plain `() => source() === value`, this only triggers the TWO
431
- * affected subscribers (deselected + newly selected) instead of ALL
432
- * subscribers, making selection O(1) regardless of list size.
433
- *
434
- * @example
435
- * const isSelected = createSelector(selectedId)
436
- * // In each row:
437
- * class: () => (isSelected(row.id) ? "selected" : "")
438
- */
439
- function createSelector(source) {
440
- const subs = /* @__PURE__ */new Map();
441
- let current;
442
- let initialized = false;
443
- effect(() => {
444
- const next = source();
445
- if (!initialized) {
446
- initialized = true;
447
- current = next;
448
- return;
449
- }
450
- if (Object.is(next, current)) return;
451
- const old = current;
452
- current = next;
453
- const oldBucket = subs.get(old);
454
- const newBucket = subs.get(next);
455
- if (oldBucket) notifyBucket(oldBucket);
456
- if (newBucket) notifyBucket(newBucket);
457
- });
458
- const hosts = /* @__PURE__ */new Map();
459
- return value => {
460
- let host = hosts.get(value);
461
- if (!host) {
462
- let bucket = subs.get(value);
463
- if (!bucket) {
464
- bucket = /* @__PURE__ */new Set();
465
- subs.set(value, bucket);
466
- }
467
- host = {
468
- _s: bucket
469
- };
470
- hosts.set(value, host);
471
- }
472
- trackSubscriber(host);
473
- return Object.is(current, value);
474
- };
475
- }
476
-
176
+ * Print a signal's current state to the console in a readable format.
177
+ *
178
+ * @example
179
+ * const count = signal(42, { name: "count" })
180
+ * inspectSignal(count)
181
+ * // Console:
182
+ * // 🔍 Signal "count"
183
+ * // value: 42
184
+ * // subscribers: 3
185
+ */
186
+ declare function inspectSignal<T>(sig: Signal<T>): SignalDebugInfo<T>;
477
187
  //#endregion
478
- //#region src/debug.ts
479
-
480
- /**
481
- * Register a listener that fires on every signal write.
482
- * Returns a dispose function.
483
- *
484
- * @example
485
- * const dispose = onSignalUpdate(e => {
486
- * console.log(`${e.name ?? 'anonymous'}: ${e.prev} → ${e.next}`)
487
- * })
488
- */
489
- function onSignalUpdate(listener) {
490
- if (!_traceListeners) _traceListeners = [];
491
- _traceListeners.push(listener);
492
- return () => {
493
- if (!_traceListeners) return;
494
- _traceListeners = _traceListeners.filter(l => l !== listener);
495
- if (_traceListeners.length === 0) _traceListeners = null;
496
- };
497
- }
498
- /** @internal — called from signal.set() when tracing is active */
499
- function _notifyTraceListeners(sig, prev, next) {
500
- if (!_traceListeners) return;
501
- const event = {
502
- signal: sig,
503
- name: sig.label,
504
- prev,
505
- next,
506
- stack: (/* @__PURE__ */new Error()).stack ?? "",
507
- timestamp: performance.now()
508
- };
509
- for (const l of _traceListeners) l(event);
510
- }
511
- /** Check if any trace listeners are active (fast path for signal.set) */
512
- function isTracing() {
513
- return _traceListeners !== null;
188
+ //#region src/effect.d.ts
189
+ interface Effect {
190
+ dispose(): void;
514
191
  }
192
+ declare function setErrorHandler(fn: (err: unknown) => void): void;
193
+ declare function effect(fn: () => (() => void) | void): Effect;
515
194
  /**
516
- * Trace the next signal update. Logs which signals fire and what changed.
517
- * Call before triggering a state change to see what updates and why.
518
- *
519
- * @example
520
- * why()
521
- * count.set(5)
522
- * // Console: [pyreon:why] "count": 3 5 (2 subscribers)
523
- */
524
- function why() {
525
- if (_whyActive) return;
526
- _whyActive = true;
527
- _whyLog = [];
528
- const dispose = onSignalUpdate(e => {
529
- const _subCount = e.signal._s?.size ?? 0;
530
- const _name = e.name ? `"${e.name}"` : "(anonymous signal)";
531
- console.log(`[pyreon:why] ${_name}: ${JSON.stringify(e.prev)} → ${JSON.stringify(e.next)} (${_subCount} subscriber${_subCount === 1 ? "" : "s"})`);
532
- _whyLog.push({
533
- name: e.name,
534
- prev: e.prev,
535
- next: e.next
536
- });
537
- });
538
- queueMicrotask(() => {
539
- dispose();
540
- if (_whyLog.length === 0) console.log("[pyreon:why] No signal updates detected");
541
- _whyActive = false;
542
- _whyLog = [];
543
- });
544
- }
195
+ * Lightweight effect for DOM render bindings.
196
+ *
197
+ * Differences from `effect()`:
198
+ * - No EffectScope registration (caller owns the dispose lifecycle)
199
+ * - No error handler (errors propagate naturally)
200
+ * - No onUpdate notification
201
+ * - Deps stored in a local array instead of the global WeakMap — faster
202
+ * creation and disposal (~200ns saved per effect vs WeakMap path)
203
+ *
204
+ * Returns a dispose function (not an Effect object — saves 1 allocation).
205
+ */
545
206
  /**
546
- * Print a signal's current state to the console in a readable format.
547
- *
548
- * @example
549
- * const count = signal(42, { name: "count" })
550
- * inspectSignal(count)
551
- * // Console:
552
- * // 🔍 Signal "count"
553
- * // value: 42
554
- * // subscribers: 3
555
- */
556
- function inspectSignal(sig) {
557
- const info = sig.debug();
558
- console.group(`🔍 Signal ${info.name ? `"${info.name}"` : "(anonymous)"}`);
559
- console.log("value:", info.value);
560
- console.log("subscribers:", info.subscriberCount);
561
- console.groupEnd();
562
- return info;
563
- }
564
-
207
+ * Static-dep binding compiler helper for template expressions.
208
+ *
209
+ * Like renderEffect but assumes dependencies never change (true for all
210
+ * compiler-emitted template bindings like `_tpl()` text/attribute updates).
211
+ *
212
+ * Tracks dependencies only on the first run. Re-runs skip cleanup, re-tracking,
213
+ * and tracking context save/restore entirely — just calls `fn()` directly.
214
+ *
215
+ * Per re-run savings vs renderEffect:
216
+ * - No deps iteration + Set.delete (cleanup)
217
+ * - No setDepsCollector + withTracking (re-registration)
218
+ * - Signal reads hit `if (activeEffect)` null check → instant return
219
+ */
220
+ declare function _bind(fn: () => void): () => void;
221
+ declare function renderEffect(fn: () => void): () => void;
565
222
  //#endregion
566
- //#region src/signal.ts
567
- function _peek() {
568
- return this._v;
569
- }
570
- function _set(newValue) {
571
- if (Object.is(this._v, newValue)) return;
572
- const prev = this._v;
573
- this._v = newValue;
574
- if (isTracing()) _notifyTraceListeners(this, prev, newValue);
575
- if (this._d) notifyDirect(this._d);
576
- if (this._s) notifySubscribers(this._s);
577
- }
578
- function _update(fn) {
579
- _set.call(this, fn(this._v));
580
- }
581
- function _subscribe(listener) {
582
- if (!this._s) this._s = /* @__PURE__ */new Set();
583
- this._s.add(listener);
584
- return () => this._s?.delete(listener);
585
- }
223
+ //#region src/reconcile.d.ts
586
224
  /**
587
- * Register a direct updater lighter than subscribe().
588
- * Uses a flat array instead of Set. Disposal nulls the slot (no Set.delete overhead).
589
- * Used by compiler-emitted _bindText/_bindDirect for zero-overhead DOM bindings.
590
- */
591
- function _directFn(updater) {
592
- if (!this._d) this._d = [];
593
- const arr = this._d;
594
- const idx = arr.length;
595
- arr.push(updater);
596
- return () => {
597
- arr[idx] = null;
598
- };
599
- }
600
- /**
601
- * Notify direct updaters flat array iteration, batch-aware.
602
- * Null slots (from disposed updaters) are skipped.
603
- */
604
- function notifyDirect(updaters) {
605
- if (isBatching()) for (let i = 0; i < updaters.length; i++) {
606
- const fn = updaters[i];
607
- if (fn) enqueuePendingNotification(fn);
608
- } else for (let i = 0; i < updaters.length; i++) updaters[i]?.();
609
- }
610
- function _debug() {
611
- return {
612
- name: this.label,
613
- value: this._v,
614
- subscriberCount: this._s?.size ?? 0
615
- };
225
+ * reconcile surgically diff new state into an existing createStore proxy.
226
+ *
227
+ * Instead of replacing the store root (which would trigger all downstream effects),
228
+ * reconcile walks both the new value and the store in parallel and only calls
229
+ * `.set()` on signals whose value actually changed.
230
+ *
231
+ * Ideal for applying API responses to a long-lived store:
232
+ *
233
+ * @example
234
+ * const state = createStore({ user: { name: "Alice", age: 30 }, items: [] })
235
+ *
236
+ * // API response arrives:
237
+ * reconcile({ user: { name: "Alice", age: 31 }, items: [{ id: 1 }] }, state)
238
+ * // → only state.user.age signal fires (name unchanged)
239
+ * // state.items[0] is newly created
240
+ *
241
+ * Arrays are reconciled by index — elements at the same index are recursively
242
+ * diffed rather than replaced wholesale. Excess old elements are removed.
243
+ */
244
+ declare function reconcile<T extends object>(source: T, target: T): void;
245
+ //#endregion
246
+ //#region src/resource.d.ts
247
+ interface Resource<T> {
248
+ /** The latest resolved value (undefined while loading or on error). */
249
+ data: Signal<T | undefined>;
250
+ /** True while a fetch is in flight. */
251
+ loading: Signal<boolean>;
252
+ /** The last error thrown by the fetcher, or undefined. */
253
+ error: Signal<unknown>;
254
+ /** Re-run the fetcher with the current source value. */
255
+ refetch(): void;
616
256
  }
617
257
  /**
618
- * Create a reactive signal.
619
- *
620
- * Only 1 closure is allocated (the read function). State is stored as
621
- * properties on the function object (_v, _s) and methods (peek, set,
622
- * update, subscribe) are shared across all signals — not per-signal closures.
623
- */
624
- function signal(initialValue, options) {
625
- const read = () => {
626
- trackSubscriber(read);
627
- return read._v;
628
- };
629
- read._v = initialValue;
630
- read._s = null;
631
- read._d = null;
632
- read.peek = _peek;
633
- read.set = _set;
634
- read.update = _update;
635
- read.subscribe = _subscribe;
636
- read.direct = _directFn;
637
- read.debug = _debug;
638
- read.label = options?.name;
639
- return read;
640
- }
641
-
258
+ * Async data primitive. Fetches data reactively whenever `source()` changes.
259
+ *
260
+ * @example
261
+ * const userId = signal(1)
262
+ * const user = createResource(userId, (id) => fetchUser(id))
263
+ * // user.data() — the fetched user (undefined while loading)
264
+ * // user.loading() — true while in flight
265
+ * // user.error() last error
266
+ */
267
+ declare function createResource<T, P>(source: () => P, fetcher: (param: P) => Promise<T>): Resource<T>;
268
+ //#endregion
269
+ //#region src/scope.d.ts
270
+ declare class EffectScope {
271
+ private _effects;
272
+ private _active;
273
+ private _updateHooks;
274
+ private _updatePending;
275
+ /** Register an effect/computed to be disposed when this scope stops. */
276
+ add(e: {
277
+ dispose(): void;
278
+ }): void;
279
+ /**
280
+ * Temporarily re-activate this scope so effects created inside `fn` are
281
+ * auto-tracked and will be disposed when the scope stops.
282
+ * Used to ensure effects created in `onMount` callbacks belong to their
283
+ * component's scope rather than leaking as global effects.
284
+ */
285
+ runInScope<T>(fn: () => T): T;
286
+ /** Register a callback to run after any reactive update in this scope. */
287
+ addUpdateHook(fn: () => void): void;
288
+ /**
289
+ * Called by effects after each non-initial re-run.
290
+ * Schedules onUpdate hooks via microtask so all synchronous effects settle first.
291
+ */
292
+ notifyEffectRan(): void;
293
+ /** Dispose all tracked effects. */
294
+ stop(): void;
295
+ }
296
+ declare function getCurrentScope(): EffectScope | null;
297
+ declare function setCurrentScope(scope: EffectScope | null): void;
298
+ /** Create a new EffectScope. */
299
+ declare function effectScope(): EffectScope;
642
300
  //#endregion
643
- //#region src/store.ts
301
+ //#region src/store.d.ts
644
302
  /**
645
- * createStore — deep reactive Proxy store.
646
- *
647
- * Wraps a plain object/array in a Proxy that creates a fine-grained signal for
648
- * every property. Direct mutations (`store.count++`, `store.items[0].label = "x"`)
649
- * trigger only the signals for the mutated properties — not the whole tree.
650
- *
651
- * @example
652
- * const state = createStore({ count: 0, items: [{ id: 1, text: "hello" }] })
653
- *
654
- * effect(() => console.log(state.count)) // tracks state.count only
655
- * state.count++ // only the count effect re-runs
656
- * state.items[0].text = "world" // only text-tracking effects re-run
657
- */
658
-
303
+ * createStore — deep reactive Proxy store.
304
+ *
305
+ * Wraps a plain object/array in a Proxy that creates a fine-grained signal for
306
+ * every property. Direct mutations (`store.count++`, `store.items[0].label = "x"`)
307
+ * trigger only the signals for the mutated properties — not the whole tree.
308
+ *
309
+ * @example
310
+ * const state = createStore({ count: 0, items: [{ id: 1, text: "hello" }] })
311
+ *
312
+ * effect(() => console.log(state.count)) // tracks state.count only
313
+ * state.count++ // only the count effect re-runs
314
+ * state.items[0].text = "world" // only text-tracking effects re-run
315
+ */
659
316
  /** Returns true if the value is a createStore proxy. */
660
- function isStore(value) {
661
- return value !== null && typeof value === "object" && value[IS_STORE] === true;
662
- }
317
+ declare function isStore(value: unknown): boolean;
663
318
  /**
664
- * Create a deep reactive store from a plain object or array.
665
- * Returns a proxy — mutations to the proxy trigger fine-grained reactive updates.
666
- */
667
- function createStore(initial) {
668
- return wrap(initial);
669
- }
670
- function wrap(raw) {
671
- const cached = proxyCache.get(raw);
672
- if (cached) return cached;
673
- const propSignals = /* @__PURE__ */new Map();
674
- const isArray = Array.isArray(raw);
675
- const lengthSig = isArray ? signal(raw.length) : null;
676
- function getOrCreateSignal(key) {
677
- if (!propSignals.has(key)) propSignals.set(key, signal(raw[key]));
678
- return propSignals.get(key);
679
- }
680
- const proxy = new Proxy(raw, {
681
- get(target, key) {
682
- if (key === IS_STORE) return true;
683
- if (typeof key === "symbol") return target[key];
684
- if (isArray && key === "length") return lengthSig?.();
685
- if (!Object.hasOwn(target, key)) return target[key];
686
- const value = getOrCreateSignal(key)();
687
- if (value !== null && typeof value === "object") return wrap(value);
688
- return value;
689
- },
690
- set(target, key, value) {
691
- if (typeof key === "symbol") {
692
- target[key] = value;
693
- return true;
694
- }
695
- const prevLength = isArray ? target.length : 0;
696
- target[key] = value;
697
- if (isArray && key === "length") {
698
- lengthSig?.set(value);
699
- return true;
700
- }
701
- if (propSignals.has(key)) propSignals.get(key)?.set(value);else propSignals.set(key, signal(value));
702
- if (isArray && target.length !== prevLength) lengthSig?.set(target.length);
703
- return true;
704
- },
705
- deleteProperty(target, key) {
706
- delete target[key];
707
- if (typeof key !== "symbol" && propSignals.has(key)) {
708
- propSignals.get(key)?.set(void 0);
709
- propSignals.delete(key);
710
- }
711
- if (isArray) lengthSig?.set(target.length);
712
- return true;
713
- },
714
- has(target, key) {
715
- return Reflect.has(target, key);
716
- },
717
- ownKeys(target) {
718
- return Reflect.ownKeys(target);
719
- },
720
- getOwnPropertyDescriptor(target, key) {
721
- return Reflect.getOwnPropertyDescriptor(target, key);
722
- }
723
- });
724
- proxyCache.set(raw, proxy);
725
- return proxy;
726
- }
727
-
319
+ * Create a deep reactive store from a plain object or array.
320
+ * Returns a proxy — mutations to the proxy trigger fine-grained reactive updates.
321
+ */
322
+ declare function createStore<T extends object>(initial: T): T;
728
323
  //#endregion
729
- //#region src/reconcile.ts
730
- /**
731
- * reconcile — surgically diff new state into an existing createStore proxy.
732
- *
733
- * Instead of replacing the store root (which would trigger all downstream effects),
734
- * reconcile walks both the new value and the store in parallel and only calls
735
- * `.set()` on signals whose value actually changed.
736
- *
737
- * Ideal for applying API responses to a long-lived store:
738
- *
739
- * @example
740
- * const state = createStore({ user: { name: "Alice", age: 30 }, items: [] })
741
- *
742
- * // API response arrives:
743
- * reconcile({ user: { name: "Alice", age: 31 }, items: [{ id: 1 }] }, state)
744
- * // → only state.user.age signal fires (name unchanged)
745
- * // → state.items[0] is newly created
746
- *
747
- * Arrays are reconciled by index — elements at the same index are recursively
748
- * diffed rather than replaced wholesale. Excess old elements are removed.
749
- */
750
- function reconcile(source, target) {
751
- _reconcileInner(source, target, /* @__PURE__ */new WeakSet());
752
- }
753
- function _reconcileInner(source, target, seen) {
754
- if (seen.has(source)) return;
755
- seen.add(source);
756
- if (Array.isArray(source) && Array.isArray(target)) _reconcileArray(source, target, seen);else _reconcileObject(source, target, seen);
757
- }
758
- function _reconcileArray(source, target, seen) {
759
- const targetLen = target.length;
760
- const sourceLen = source.length;
761
- for (let i = 0; i < sourceLen; i++) {
762
- const sv = source[i];
763
- const tv = target[i];
764
- if (i < targetLen && sv !== null && typeof sv === "object" && tv !== null && typeof tv === "object") _reconcileInner(sv, tv, seen);else target[i] = sv;
765
- }
766
- if (targetLen > sourceLen) target.length = sourceLen;
767
- }
768
- function _reconcileObject(source, target, seen) {
769
- const sourceKeys = Object.keys(source);
770
- const targetKeys = new Set(Object.keys(target));
771
- for (const key of sourceKeys) {
772
- const sv = source[key];
773
- const tv = target[key];
774
- if (sv !== null && typeof sv === "object" && tv !== null && typeof tv === "object") {
775
- if (isStore(tv)) _reconcileInner(sv, tv, seen);else target[key] = sv;
776
- } else target[key] = sv;
777
- targetKeys.delete(key);
778
- }
779
- for (const key of targetKeys) delete target[key];
780
- }
781
-
324
+ //#region src/tracking.d.ts
325
+ declare function runUntracked<T>(fn: () => T): T;
782
326
  //#endregion
783
- //#region src/resource.ts
784
- /**
785
- * Async data primitive. Fetches data reactively whenever `source()` changes.
786
- *
787
- * @example
788
- * const userId = signal(1)
789
- * const user = createResource(userId, (id) => fetchUser(id))
790
- * // user.data() — the fetched user (undefined while loading)
791
- * // user.loading() — true while in flight
792
- * // user.error() — last error
793
- */
794
- function createResource(source, fetcher) {
795
- const data = signal(void 0);
796
- const loading = signal(false);
797
- const error = signal(void 0);
798
- let requestId = 0;
799
- const doFetch = param => {
800
- const id = ++requestId;
801
- loading.set(true);
802
- error.set(void 0);
803
- fetcher(param).then(result => {
804
- if (id !== requestId) return;
805
- data.set(result);
806
- loading.set(false);
807
- }).catch(err => {
808
- if (id !== requestId) return;
809
- error.set(err);
810
- loading.set(false);
811
- });
812
- };
813
- effect(() => {
814
- const param = source();
815
- runUntracked(() => doFetch(param));
816
- });
817
- return {
818
- data,
819
- loading,
820
- error,
821
- refetch() {
822
- runUntracked(() => doFetch(source()));
823
- }
824
- };
327
+ //#region src/watch.d.ts
328
+ interface WatchOptions {
329
+ /** If true, call the callback immediately with the current value on setup. Default: false. */
330
+ immediate?: boolean;
825
331
  }
826
-
827
- //#endregion
828
- //#region src/watch.ts
829
332
  /**
830
- * Watch a reactive source and run a callback whenever it changes.
831
- *
832
- * Returns a stop function that disposes the watcher.
833
- *
834
- * The callback receives (newValue, oldValue). On the first call (when
835
- * `immediate` is true) oldValue is `undefined`.
836
- *
837
- * The callback may return a cleanup function that is called before each
838
- * re-run and on stop — useful for cancelling async work.
839
- *
840
- * @example
841
- * const stop = watch(
842
- * () => userId(),
843
- * async (id, prev) => {
844
- * const data = await fetch(`/api/user/${id}`)
845
- * setUser(await data.json())
846
- * },
847
- * )
848
- * // Later: stop()
849
- */
850
- function watch(source, callback, opts = {}) {
851
- let oldVal;
852
- let isFirst = true;
853
- let cleanupFn;
854
- const e = effect(() => {
855
- const newVal = source();
856
- if (isFirst) {
857
- isFirst = false;
858
- oldVal = newVal;
859
- if (opts.immediate) {
860
- const result = callback(newVal, void 0);
861
- if (typeof result === "function") cleanupFn = result;
862
- }
863
- return;
864
- }
865
- if (cleanupFn) {
866
- cleanupFn();
867
- cleanupFn = void 0;
868
- }
869
- const result = callback(newVal, oldVal);
870
- if (typeof result === "function") cleanupFn = result;
871
- oldVal = newVal;
872
- });
873
- return () => {
874
- e.dispose();
875
- if (cleanupFn) {
876
- cleanupFn();
877
- cleanupFn = void 0;
878
- }
879
- };
880
- }
881
-
333
+ * Watch a reactive source and run a callback whenever it changes.
334
+ *
335
+ * Returns a stop function that disposes the watcher.
336
+ *
337
+ * The callback receives (newValue, oldValue). On the first call (when
338
+ * `immediate` is true) oldValue is `undefined`.
339
+ *
340
+ * The callback may return a cleanup function that is called before each
341
+ * re-run and on stop — useful for cancelling async work.
342
+ *
343
+ * @example
344
+ * const stop = watch(
345
+ * () => userId(),
346
+ * async (id, prev) => {
347
+ * const data = await fetch(`/api/user/${id}`)
348
+ * setUser(await data.json())
349
+ * },
350
+ * )
351
+ * // Later: stop()
352
+ */
353
+ declare function watch<T>(source: () => T, callback: (newVal: T, oldVal: T | undefined) => void | (() => void), opts?: WatchOptions): () => void;
882
354
  //#endregion
883
- export { Cell, EffectScope, _bind, batch, cell, computed, createResource, createSelector, createStore, effect, effectScope, getCurrentScope, inspectSignal, isStore, nextTick, onSignalUpdate, reconcile, renderEffect, runUntracked, setCurrentScope, setErrorHandler, signal, watch, why };
884
- //# sourceMappingURL=index.d.ts.map
355
+ export { Cell, type Computed, type ComputedOptions, type Effect, EffectScope, type ReadonlySignal, type Resource, type Signal, type SignalDebugInfo, type SignalOptions, type WatchOptions, _bind, batch, cell, computed, createResource, createSelector, createStore, effect, effectScope, getCurrentScope, inspectSignal, isStore, nextTick, onSignalUpdate, reconcile, renderEffect, runUntracked, setCurrentScope, setErrorHandler, signal, watch, why };
356
+ //# sourceMappingURL=index2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["cleanupLocalDeps"],"sources":["../../../src/batch.ts","../../../src/cell.ts","../../../src/scope.ts","../../../src/tracking.ts","../../../src/computed.ts","../../../src/effect.ts","../../../src/createSelector.ts","../../../src/debug.ts","../../../src/signal.ts","../../../src/store.ts","../../../src/reconcile.ts","../../../src/resource.ts","../../../src/watch.ts"],"mappings":"AAaA,SAAgB,KAAA,CAAM,EAAA,EAAsB;EAC1C,UAAA,EAAA;EACA,IAAI;IACF,EAAA,CAAA,CAAI;YACI;IACR,UAAA,EAAA;IACA,IAAI,UAAA,KAAe,CAAA,IAAK,oBAAA,CAAqB,IAAA,GAAO,CAAA,EAAG;MAIrD,MAAM,KAAA,GAAQ,oBAAA;MACd,oBAAA,GAAuB,KAAA,KAAU,IAAA,GAAO,IAAA,GAAO,IAAA;MAC/C,KAAK,MAAM,MAAA,IAAU,KAAA,EAAO,MAAA,CAAA,CAAQ;MACpC,KAAA,CAAM,KAAA,CAAA,CAAO;;;;AAKnB,SAAgB,UAAA,CAAA,EAAsB;EACpC,OAAO,UAAA,GAAa,CAAA;;AAGtB,SAAgB,0BAAA,CAA2B,MAAA,EAA0B;EACnE,oBAAA,CAAqB,GAAA,CAAI,MAAA,CAAO;;;;;;;;;;;AAYlC,SAAgB,QAAA,CAAA,EAA0B;EACxC,OAAO,IAAI,OAAA,CAAS,OAAA,IAAY,cAAA,CAAe,OAAA,CAAQ,CAAC;;;;;;;;;;;;;;;;;;ACmB1D,SAAgB,IAAA,CAAQ,KAAA,EAAmB;EACzC,OAAO,IAAI,IAAA,CAAK,KAAA,CAAM;;;;;;ACDxB,SAAgB,eAAA,CAAA,EAAsC;EACpD,OAAO,aAAA;;AAGT,SAAgB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,CAAS,MAAA,EAAQ,KAAA,CAAA,CAAU;QAC1C,IAAI,OAAO,MAAA,KAAW,UAAA,EAAY,SAAA,GAAY,MAAA;;MAEhD;;IAGF,IAAI,SAAA,EAAW;MACb,SAAA,CAAA,CAAW;MACX,SAAA,GAAY,KAAA,CAAA;;IAGd,MAAM,MAAA,GAAS,QAAA,CAAS,MAAA,EAAQ,MAAA,CAAO;IACvC,IAAI,OAAO,MAAA,KAAW,UAAA,EAAY,SAAA,GAAY,MAAA;IAC9C,MAAA,GAAS,MAAA;IACT;EAEF,OAAA,MAAa;IACX,CAAA,CAAE,OAAA,CAAA,CAAS;IACX,IAAI,SAAA,EAAW;MACb,SAAA,CAAA,CAAW;MACX,SAAA,GAAY,KAAA,CAAA"}
1
+ {"version":3,"file":"index2.d.ts","names":[],"sources":["../../../src/batch.ts","../../../src/cell.ts","../../../src/computed.ts","../../../src/createSelector.ts","../../../src/signal.ts","../../../src/debug.ts","../../../src/effect.ts","../../../src/reconcile.ts","../../../src/resource.ts","../../../src/scope.ts","../../../src/store.ts","../../../src/tracking.ts","../../../src/watch.ts"],"mappings":";iBAagB,KAAA,CAAM,EAAA;;;;AAmCtB;;;;;;iBAAgB,QAAA,CAAA,GAAY,OAAA;;;;AAnC5B;;;;;AAmCA;;;;;;cCpCa,IAAA;;EACM,EAAA,EAAI,CAAA;EADV;EAEM,EAAA;EAFF;EAGE,EAAA,EAAI,GAAA;cAET,KAAA,EAAO,CAAA;EAInB,IAAA,CAAA,GAAQ,CAAA;EAIR,GAAA,CAAI,KAAA,EAAO,CAAA;EAOX,MAAA,CAAO,EAAA,GAAK,OAAA,EAAS,CAAA,KAAM,CAAA;EAXnB;;;;;EAoBR,MAAA,CAAO,QAAA;EAgBP,SAAA,CAAU,QAAA;AAAA;AAAA,iBAWI,IAAA,GAAA,CAAQ,KAAA,EAAO,CAAA,GAAI,IAAA,CAAK,CAAA;;;UC1DvB,QAAA;EAAA,IACX,CAAA;EFEe;EEAnB,OAAA;AAAA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AA;;;iBC8F3C,YAAA,GAAA,CAAgB,EAAA,QAAU,CAAA,GAAI,CAAA;;;UC/H7B,YAAA;EZWD;EYTd,SAAA;AAAA;;;AZ4CF;;;;;;;;ACpCA;;;;;;;;;;;iBWgBgB,KAAA,GAAA,CACd,MAAA,QAAc,CAAA,EAEd,QAAA,GAAW,MAAA,EAAQ,CAAA,EAAG,MAAA,EAAQ,CAAA,sCAC9B,IAAA,GAAM,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyreon/reactivity",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Signals-based reactivity system for Pyreon",
5
5
  "license": "MIT",
6
6
  "repository": {