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
FEAT: `untrack()` now accepts signals and stores directly, as well as accepting arguments when you pass a function. This makes retrieving values without subscribing to them more efficient.
Copy file name to clipboardExpand all lines: packages/docs/src/routes/api/qwik/api.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3006,7 +3006,7 @@
3006
3006
}
3007
3007
],
3008
3008
"kind": "Function",
3009
-
"content": "Don't track listeners for this callback\n\n\n```typescript\nuntrack: <T>(fn: () => T) => T\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nfn\n\n\n</td><td>\n\n() => T\n\n\n</td><td>\n\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT",
3009
+
"content": "Get the value of the expression without tracking listeners. A function will be invoked, signals will return their value, and stores will be unwrapped (they return the backing object).\n\nWhen you pass a function, you can also pass additional arguments that the function will receive.\n\nNote that stores are not unwrapped recursively.\n\n\n```typescript\nuntrack: <T, A extends any[]>(expr: ((...args: A) => T) | Signal<T> | T, ...args: A) => T\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nexpr\n\n\n</td><td>\n\n((...args: A) => T) \\| [Signal](#signal)<!-- --><T> \\| T\n\n\n</td><td>\n\nThe function or object to evaluate without tracking.\n\n\n</td></tr>\n<tr><td>\n\nargs\n\n\n</td><td>\n\nA\n\n\n</td><td>\n\nAdditional arguments to pass when `expr` is a function.\n\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nT",
Get the value of the expression without tracking listeners. A function will be invoked, signals will return their value, and stores will be unwrapped (they return the backing object).
10082
+
10083
+
When you pass a function, you can also pass additional arguments that the function will receive.
10084
+
10085
+
Note that stores are not unwrapped recursively.
10082
10086
10083
10087
```typescript
10084
-
untrack: <T>(fn: () =>T) =>T;
10088
+
untrack: <T, Aextendsany[]>(
10089
+
expr: ((...args:A) =>T) |Signal<T> |T,
10090
+
...args:A
10091
+
) =>T;
10085
10092
```
10086
10093
10087
10094
<table><thead><tr><th>
@@ -10099,14 +10106,29 @@ Description
10099
10106
</th></tr></thead>
10100
10107
<tbody><tr><td>
10101
10108
10102
-
fn
10109
+
expr
10110
+
10111
+
</td><td>
10112
+
10113
+
((...args: A) => T) \| [Signal](#signal)<T> \| T
10114
+
10115
+
</td><td>
10116
+
10117
+
The function or object to evaluate without tracking.
10118
+
10119
+
</td></tr>
10120
+
<tr><td>
10121
+
10122
+
args
10103
10123
10104
10124
</td><td>
10105
10125
10106
-
() => T
10126
+
A
10107
10127
10108
10128
</td><td>
10109
10129
10130
+
Additional arguments to pass when `expr` is a function.
0 commit comments