Skip to content

Commit a8c6b92

Browse files
authored
chore: remove $state.is from docs (#12927)
1 parent 44a780f commit a8c6b92

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

sites/svelte-5-preview/src/lib/autocomplete.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ const runes = [
118118
{ snippet: '$bindable()', test: is_bindable },
119119
{ snippet: '$effect.root(() => {\n\t${}\n})' },
120120
{ snippet: '$state.snapshot(${})' },
121-
{ snippet: '$state.is(${})' },
122121
{ snippet: '$effect.tracking()' },
123122
{ snippet: '$inspect(${});', test: is_statement }
124123
];

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,6 @@ To take a static snapshot of a deeply reactive `$state` proxy, use `$state.snaps
108108

109109
This is handy when you want to pass some state to an external library or API that doesn't expect a proxy, such as `structuredClone`.
110110

111-
## `$state.is`
112-
113-
Sometimes you might need to compare two values, one of which is a reactive `$state(...)` proxy. For this you can use `$state.is(a, b)`:
114-
115-
```svelte
116-
<script>
117-
let foo = $state({});
118-
let bar = {};
119-
120-
foo.bar = bar;
121-
122-
console.log(foo.bar === bar); // false — `foo.bar` is a reactive proxy
123-
console.log($state.is(foo.bar, bar)); // true
124-
</script>
125-
```
126-
127-
This is handy when you might want to check if the object exists within a deeply reactive object/array.
128-
129-
> `$state.is` uses `Object.is` to check if two values are the same value.
130-
131111
## `$derived`
132112

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

0 commit comments

Comments
 (0)