Update site/content/docs/01-component-format.md

Co-Authored-By: Josh Duff <me@JoshDuff.com>
pull/4226/head
Conduitry 6 years ago committed by GitHub
parent 2a5777d8bd
commit 1b4fae8fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -184,7 +184,7 @@ You can create your own stores without relying on [`svelte/store`](docs#svelte_s
2. The `.subscribe` method must return an unsubscribe function. Calling an unsubscribe function must stop its subscription, and its corresponding subscription function must not be called again by the store.
3. A store may *optionally* contain a `.set` method, which must accept as its argument a new value for the store, and which synchronously calls all of the store's active subscription functions. Such a store is called a *writable store*.
For interoperability with RxJS/TC39 Observables, the `.subscribe` method is also allowed to return an object with an `.unsubscribe` method, rather than return the unsubscription function directly. Note however that unless `.subscribe` synchronously calls the subscription (which is not required by the Observable spec), Svelte will see the value of the store as `undefined` until it does.
For interoperability with RxJS Observables, the `.subscribe` method is also allowed to return an object with an `.unsubscribe` method, rather than return the unsubscription function directly. Note however that unless `.subscribe` synchronously calls the subscription (which is not required by the Observable spec), Svelte will see the value of the store as `undefined` until it does.
### &lt;script context="module"&gt;

Loading…
Cancel
Save