From 26f0bad7b6cd83990134e01a6c85dc09bcaa702a Mon Sep 17 00:00:00 2001 From: Joseph Abrahamson Date: Wed, 11 Mar 2020 08:41:02 -0400 Subject: [PATCH] docs: fix store contract type signature The store contract documentation states that the subscribe method "must return an unsubscribe function", but its signature suggested that it instead took a second, unit argument then returned `void`. This PR adds parentheses to reflect the intended meaning. I haven't given a name to the unit argument to the unsubscribe function. --- site/content/docs/01-component-format.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/content/docs/01-component-format.md b/site/content/docs/01-component-format.md index 07a59c69f8..fa851ccc41 100644 --- a/site/content/docs/01-component-format.md +++ b/site/content/docs/01-component-format.md @@ -175,7 +175,7 @@ Local variables (that do not represent store values) must *not* have a `$` prefi ##### Store contract ```js -store = { subscribe: (subscription: (value: any) => void) => () => void, set?: (value: any) => void } +store = { subscribe: (subscription: (value: any) => void) => (() => void), set?: (value: any) => void } ``` You can create your own stores without relying on [`svelte/store`](docs#svelte_store), by implementing the *store contract*: