From 0efe031edc61e01e175caf0f8b9cb259c05e6ce8 Mon Sep 17 00:00:00 2001 From: gubo97000 Date: Thu, 31 Oct 2024 01:25:28 +0200 Subject: [PATCH] Update 07-$inspect.md (#14048) moved note to top --- documentation/docs/02-runes/07-$inspect.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/docs/02-runes/07-$inspect.md b/documentation/docs/02-runes/07-$inspect.md index 07429a2818..1afe25deca 100644 --- a/documentation/docs/02-runes/07-$inspect.md +++ b/documentation/docs/02-runes/07-$inspect.md @@ -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 @@ -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.