From bbc8106405b915e1b5f6b0d48a58908ad40c03c8 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Sat, 19 Apr 2025 13:56:35 +0800 Subject: [PATCH 1/3] Update 02-$state.md --- documentation/docs/02-runes/02-$state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/02-runes/02-$state.md b/documentation/docs/02-runes/02-$state.md index 16630a977b62..d31aadfbe572 100644 --- a/documentation/docs/02-runes/02-$state.md +++ b/documentation/docs/02-runes/02-$state.md @@ -20,7 +20,7 @@ Unlike other frameworks you may have encountered, there is no API for interactin If `$state` is used with an array or a simple object, the result is a deeply reactive _state proxy_. [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) allow Svelte to run code when you read or write properties, including via methods like `array.push(...)`, triggering granular updates. -> [!NOTE] Classes like `Set` and `Map` will not be proxied, but Svelte provides reactive implementations for various built-ins like these that can be imported from [`svelte/reactivity`](./svelte-reactivity). +> [!NOTE] Classes will not be proxied. They need to be explicitly [implemented](./$state#Classes) with reactivity in mind. Svelte provides a reactive version of common built-ins which can be imported from [`svelte/reactivity`](./svelte-reactivity). State is proxified recursively until Svelte finds something other than an array or simple object. In a case like this... From 9a37a6eef80b3436b6650dd9267dc0346e1bbf60 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Sat, 19 Apr 2025 14:01:44 +0800 Subject: [PATCH 2/3] Update 02-$state.md --- documentation/docs/02-runes/02-$state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/02-runes/02-$state.md b/documentation/docs/02-runes/02-$state.md index d31aadfbe572..1cd4b839886f 100644 --- a/documentation/docs/02-runes/02-$state.md +++ b/documentation/docs/02-runes/02-$state.md @@ -20,7 +20,7 @@ Unlike other frameworks you may have encountered, there is no API for interactin If `$state` is used with an array or a simple object, the result is a deeply reactive _state proxy_. [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) allow Svelte to run code when you read or write properties, including via methods like `array.push(...)`, triggering granular updates. -> [!NOTE] Classes will not be proxied. They need to be explicitly [implemented](./$state#Classes) with reactivity in mind. Svelte provides a reactive version of common built-ins which can be imported from [`svelte/reactivity`](./svelte-reactivity). +> [!NOTE] Classes will not be proxied. They need to be explicitly [implemented](./$state#Classes) with reactivity in mind. Svelte provides reactive implementations for various built-ins that can be imported from [`svelte/reactivity`](./svelte-reactivity). State is proxified recursively until Svelte finds something other than an array or simple object. In a case like this... From 9f4eeb7693f440bd7f231db06c57aa95ceeace92 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Sat, 19 Apr 2025 14:05:11 +0800 Subject: [PATCH 3/3] Update 02-$state.md --- documentation/docs/02-runes/02-$state.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/docs/02-runes/02-$state.md b/documentation/docs/02-runes/02-$state.md index 1cd4b839886f..1c2c8226dbfe 100644 --- a/documentation/docs/02-runes/02-$state.md +++ b/documentation/docs/02-runes/02-$state.md @@ -20,7 +20,7 @@ Unlike other frameworks you may have encountered, there is no API for interactin If `$state` is used with an array or a simple object, the result is a deeply reactive _state proxy_. [Proxies](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) allow Svelte to run code when you read or write properties, including via methods like `array.push(...)`, triggering granular updates. -> [!NOTE] Classes will not be proxied. They need to be explicitly [implemented](./$state#Classes) with reactivity in mind. Svelte provides reactive implementations for various built-ins that can be imported from [`svelte/reactivity`](./svelte-reactivity). +> [!NOTE] Classes will not be proxied. Reactivity should be [implemented explicitly](./$state#Classes). Reactive implementations for various built-ins that can be imported from [`svelte/reactivity`](./svelte-reactivity). State is proxified recursively until Svelte finds something other than an array or simple object. In a case like this...