Skip to content

Commit

Permalink
more details on $state.is, closes sveltejs/svelte#12167
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jun 25, 2024
1 parent cb7145c commit 6783e77
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/svelte.dev/content/docs/svelte/03-runes/01-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ Sometimes you might need to compare two values, one of which is a reactive `$sta

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

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.

> 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
## `$derived`

Derived state is declared with the `$derived` rune:
Expand Down

0 comments on commit 6783e77

Please sign in to comment.