You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/svelte/src/internal/client/runtime.js
+36-27Lines changed: 36 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -127,8 +127,14 @@ export function set_untracked_writes(value) {
127
127
untracked_writes=value;
128
128
}
129
129
130
-
/** @type {number} Used by sources and deriveds for handling updates to unowned deriveds it starts from 1 to differentiate between a created effect and a run one for tracing */
131
-
letcurrent_version=1;
130
+
/**
131
+
* @type {number} Used by sources and deriveds for handling updates.
132
+
* Version starts from 1 so that unowned deriveds differentiate between a created effect and a run one for tracing
133
+
**/
134
+
letwrite_version=1;
135
+
136
+
/** @type {number} Used to version each read of a source of derived to avoid duplicating depedencies inside a reaction */
137
+
letread_version=0;
132
138
133
139
// If we are working with a get() chain that has no active container,
134
140
// to prevent memory leaks, we skip adding the reaction.
@@ -168,8 +174,8 @@ export function set_dev_current_component_function(fn) {
168
174
dev_current_component_function=fn;
169
175
}
170
176
171
-
exportfunctionincrement_version(){
172
-
return++current_version;
177
+
exportfunctionincrement_write_version(){
178
+
return++write_version;
173
179
}
174
180
175
181
/** @returns {boolean} */
@@ -226,7 +232,7 @@ export function check_dirtiness(reaction) {
0 commit comments