From a8c6b92f9a46166fc9ce1906f1608795aae3a00e Mon Sep 17 00:00:00 2001 From: Dominic Gannaway Date: Tue, 20 Aug 2024 16:55:22 +0100 Subject: [PATCH] chore: remove $state.is from docs (#12927) --- .../svelte-5-preview/src/lib/autocomplete.js | 1 - .../routes/docs/content/01-api/02-runes.md | 20 ------------------- 2 files changed, 21 deletions(-) diff --git a/sites/svelte-5-preview/src/lib/autocomplete.js b/sites/svelte-5-preview/src/lib/autocomplete.js index 99ec238834..b535c7ff04 100644 --- a/sites/svelte-5-preview/src/lib/autocomplete.js +++ b/sites/svelte-5-preview/src/lib/autocomplete.js @@ -118,7 +118,6 @@ const runes = [ { snippet: '$bindable()', test: is_bindable }, { snippet: '$effect.root(() => {\n\t${}\n})' }, { snippet: '$state.snapshot(${})' }, - { snippet: '$state.is(${})' }, { snippet: '$effect.tracking()' }, { snippet: '$inspect(${});', test: is_statement } ]; diff --git a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md index 2cc70d0536..02cea6ffb4 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md +++ b/sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md @@ -108,26 +108,6 @@ To take a static snapshot of a deeply reactive `$state` proxy, use `$state.snaps 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`. -## `$state.is` - -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)`: - -```svelte - -``` - -This is handy when you might want to check if the object exists within a deeply reactive object/array. - -> `$state.is` uses `Object.is` to check if two values are the same value. - ## `$derived` Derived state is declared with the `$derived` rune: