From 937c7c9c4a6c8d09fafa54e0f1b98db8471f8c0d Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Mon, 12 Jul 2021 10:24:32 +0200 Subject: [PATCH] [docs] document $store behavior more explicitely Closes #4677 --- site/content/docs/01-component-format.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index 05c55f9e0f..0d8cc6a43e 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -177,7 +177,7 @@ If a statement consists entirely of an assignment to an undeclared variable, Sve A *store* is an object that allows reactive access to a value via a simple *store contract*. The [`svelte/store` module](docs#svelte_store) contains minimal store implementations which fulfil this contract. -Any time you have a reference to a store, you can access its value inside a component by prefixing it with the `$` character. This causes Svelte to declare the prefixed variable, and set up a store subscription that will be unsubscribed when appropriate. +Any time you have a reference to a store, you can access its value inside a component by prefixing it with the `$` character. This causes Svelte to declare the prefixed variable, subscribe to the store at component initialization and unsubscribe when appropriate. Assignments to `$`-prefixed variables require that the variable be a writable store, and will result in a call to the store's `.set` method. @@ -321,4 +321,4 @@ In that case, the ` -``` \ No newline at end of file +```