Skip to content

Commit 6783e77

Browse files
committed
more details on $state.is, closes sveltejs/svelte#12167
1 parent cb7145c commit 6783e77

File tree

1 file changed

+4
-0
lines changed
  • apps/svelte.dev/content/docs/svelte/03-runes

1 file changed

+4
-0
lines changed

apps/svelte.dev/content/docs/svelte/03-runes/01-state.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ Sometimes you might need to compare two values, one of which is a reactive `$sta
122122

123123
This is handy when you might want to check if the object exists within a deeply reactive object/array.
124124

125+
Under the hood, `$state.is` uses [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) for comparing the values.
126+
127+
> Use this as an escape hatch - most of the time you don't need this. Svelte will warn you at dev time if you happen to run into this problem
128+
125129
## `$derived`
126130

127131
Derived state is declared with the `$derived` rune:

0 commit comments

Comments
 (0)