Skip to content

Commit af017da

Browse files
committed
document console.trace trick
1 parent 1c781a3 commit af017da

File tree

1 file changed

+6
-0
lines changed
  • sites/svelte-5-preview/src/routes/docs/content/01-api

1 file changed

+6
-0
lines changed

sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,12 @@ is the current value. The second is either `"init"` or `"update"`.
278278
<button onclick={() => count++}>Increment</button>
279279
```
280280

281+
A convenient way to find the origin of some change is to pass `console.trace` as the second argument:
282+
283+
```js
284+
$inspect(stuff, console.trace);
285+
```
286+
281287
> `$inspect` only works during development.
282288
283289
## How to opt in

0 commit comments

Comments
 (0)