Skip to content

Commit ec1b7d8

Browse files
committed
move parent property onto Signal
1 parent c436b6c commit ec1b7d8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/svelte/src/internal/client/reactivity/sources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export function source(v, stack) {
5656
var signal = {
5757
f: 0, // TODO ideally we could skip this altogether, but it causes type errors
5858
v,
59+
parent: active_reaction,
5960
reactions: null,
6061
equals,
6162
rv: 0,

packages/svelte/src/internal/client/reactivity/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ export interface Signal {
55
f: number;
66
/** Write version */
77
wv: number;
8+
/** Parent effect or derived */
9+
parent: Reaction | null;
810
}
911

1012
export interface Value<V = unknown> extends Signal {
@@ -38,8 +40,6 @@ export interface Derived<V = unknown> extends Value<V>, Reaction {
3840
fn: () => V;
3941
/** Effects created inside this signal */
4042
effects: null | Effect[];
41-
/** Parent effect or derived */
42-
parent: Effect | Derived | null;
4343
}
4444

4545
export interface Effect extends Reaction {

0 commit comments

Comments
 (0)