Skip to content

Commit

Permalink
Update 07-$inspect.md (#14048)
Browse files Browse the repository at this point in the history
moved note to top
  • Loading branch information
gubo97000 authored Oct 30, 2024
1 parent ee2f4a2 commit 0efe031
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions documentation/docs/02-runes/07-$inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: $inspect
---

> [!NOTE] `$inspect` only works during development. In a production build it becomes a noop.
The `$inspect` rune is roughly equivalent to `console.log`, with the exception that it will re-run whenever its argument changes. `$inspect` tracks reactive state deeply, meaning that updating something inside an object or array using fine-grained reactivity will cause it to re-fire ([demo](/playground/untitled#H4sIAAAAAAAACkWQ0YqDQAxFfyUMhSotdZ-tCvu431AXtGOqQ2NmmMm0LOK_r7Utfby5JzeXTOpiCIPKT5PidkSVq2_n1F7Jn3uIcEMSXHSw0evHpAjaGydVzbUQCmgbWaCETZBWMPlKj29nxBDaHj_edkAiu12JhdkYDg61JGvE_s2nR8gyuBuiJZuDJTyQ7eE-IEOzog1YD80Lb0APLfdYc5F9qnFxjiKWwbImo6_llKRQVs-2u91c_bD2OCJLkT3JZasw7KLA2XCX31qKWE6vIzNk1fKE0XbmYrBTufiI8-_8D2cUWBA_AQAA)):

```svelte
Expand Down Expand Up @@ -40,5 +42,3 @@ A convenient way to find the origin of some change is to pass `console.trace` to
// @errors: 2304
$inspect(stuff).with(console.trace);
```

> [!NOTE] `$inspect` only works during development. In a production build it becomes a noop.

0 comments on commit 0efe031

Please sign in to comment.