From 51473d6154371a7e5f278c0c6ed746f715791fe9 Mon Sep 17 00:00:00 2001 From: trbrc Date: Sun, 5 Jan 2020 22:09:10 +0100 Subject: [PATCH] Summary of store contract in `svelte/store` docs --- site/content/docs/03-run-time.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/site/content/docs/03-run-time.md b/site/content/docs/03-run-time.md index 5bcbe8764c..016b562c66 100644 --- a/site/content/docs/03-run-time.md +++ b/site/content/docs/03-run-time.md @@ -214,7 +214,11 @@ Events dispatched from child components can be listened to in their parent. Any ### `svelte/store` -The `svelte/store` module exports functions for creating [stores](docs#4_Prefix_stores_with_$_to_access_their_values). +The `svelte/store` module exports functions for creating [readable](docs#readable), [writable](docs#writable) and [derived](docs#derived) stores. + +Keep in mind that you don't *have* to use these functions to enjoy the [reactive `$store` syntax](docs#4_Prefix_stores_with_$_to_access_their_values) in your components. Any object that correctly implements `subscribe`/`unsubscribe` and (optionally) `set` is a valid store, and will work both with the special syntax, and with Svelte's built in [`derived` stores](docs#derived). + +This makes it possible to wrap almost any other reactive state handling library for use in Svelte. Read more about the [store contract](docs#4_Prefix_stores_with_$_to_access_their_values) to see what a correct implementation looks like. #### `writable`