add note at top

update-store-docs
Rich Harris 10 months ago
parent e58c03b100
commit cef6191097

@ -6,7 +6,9 @@ title: Stores
- how to write
- TODO should the details for the store methods belong to the reference section? -->
A _store_ is an object that allows reactive access to a value via a simple _store contract_. The [`svelte/store` module](../svelte-store) contains minimal store implementations which fulfil this contract.
> [!NOTE] Prior to the introduction of runes, stores were the primary state management mechanism for anything that couldn't be expressed as component state or props. With runes — which can be used in [`.svelte.js/ts`](svelte-js-files) files as well as in components — stores are rarely necessary, though you will still sometimes encounter them when using Svelte. See [When to use stores](#When-to-use-stores) below.
A _store_ is an object that allows reactive access to a value via a simple _store contract_. The [`svelte/store`](../svelte-store) module contains minimal store implementations that 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, subscribe to the store at component initialisation and unsubscribe when appropriate.

Loading…
Cancel
Save