diff --git a/site/content/examples/07-stores/04-custom-stores/App.svelte b/site/content/examples/07-stores/04-custom-stores/App.svelte index a320cc052ffd..a7fd0066dd77 100644 --- a/site/content/examples/07-stores/04-custom-stores/App.svelte +++ b/site/content/examples/07-stores/04-custom-stores/App.svelte @@ -6,4 +6,5 @@ + \ No newline at end of file diff --git a/site/content/examples/07-stores/04-custom-stores/stores.js b/site/content/examples/07-stores/04-custom-stores/stores.js index 5a26025b0312..a94badf81227 100644 --- a/site/content/examples/07-stores/04-custom-stores/stores.js +++ b/site/content/examples/07-stores/04-custom-stores/stores.js @@ -7,6 +7,7 @@ function createCount() { subscribe, increment: () => update(n => n + 1), decrement: () => update(n => n - 1), + change: (parameter) => set(parameter), reset: () => set(0) }; } diff --git a/site/content/tutorial/08-stores/05-custom-stores/app-a/App.svelte b/site/content/tutorial/08-stores/05-custom-stores/app-a/App.svelte index a320cc052ffd..14599c04e800 100644 --- a/site/content/tutorial/08-stores/05-custom-stores/app-a/App.svelte +++ b/site/content/tutorial/08-stores/05-custom-stores/app-a/App.svelte @@ -6,4 +6,5 @@ + \ No newline at end of file diff --git a/site/content/tutorial/08-stores/05-custom-stores/app-a/stores.js b/site/content/tutorial/08-stores/05-custom-stores/app-a/stores.js index ccb322652bd0..2789c1fb0939 100644 --- a/site/content/tutorial/08-stores/05-custom-stores/app-a/stores.js +++ b/site/content/tutorial/08-stores/05-custom-stores/app-a/stores.js @@ -7,6 +7,7 @@ function createCount() { subscribe, increment: () => {}, decrement: () => {}, + change: () => {}, reset: () => {} }; } diff --git a/site/content/tutorial/08-stores/05-custom-stores/app-b/App.svelte b/site/content/tutorial/08-stores/05-custom-stores/app-b/App.svelte index a320cc052ffd..a7fd0066dd77 100644 --- a/site/content/tutorial/08-stores/05-custom-stores/app-b/App.svelte +++ b/site/content/tutorial/08-stores/05-custom-stores/app-b/App.svelte @@ -6,4 +6,5 @@ + \ No newline at end of file diff --git a/site/content/tutorial/08-stores/05-custom-stores/app-b/stores.js b/site/content/tutorial/08-stores/05-custom-stores/app-b/stores.js index 5a26025b0312..a94badf81227 100644 --- a/site/content/tutorial/08-stores/05-custom-stores/app-b/stores.js +++ b/site/content/tutorial/08-stores/05-custom-stores/app-b/stores.js @@ -7,6 +7,7 @@ function createCount() { subscribe, increment: () => update(n => n + 1), decrement: () => update(n => n - 1), + change: (parameter) => set(parameter), reset: () => set(0) }; } diff --git a/site/content/tutorial/08-stores/05-custom-stores/text.md b/site/content/tutorial/08-stores/05-custom-stores/text.md index febd0ad7f71b..e83f6f5c68ef 100644 --- a/site/content/tutorial/08-stores/05-custom-stores/text.md +++ b/site/content/tutorial/08-stores/05-custom-stores/text.md @@ -4,7 +4,7 @@ title: Custom stores As long as an object correctly implements the `subscribe` method, it's a store. Beyond that, anything goes. It's very easy, therefore, to create custom stores with domain-specific logic. -For example, the `count` store from our earlier example could include `increment`, `decrement` and `reset` methods and avoid exposing `set` and `update`: +For example, the `count` store from our earlier example could include `increment`, `decrement`, `change` and `reset` methods and avoid exposing `set` and `update`: ```js function createCount() { @@ -14,6 +14,7 @@ function createCount() { subscribe, increment: () => update(n => n + 1), decrement: () => update(n => n - 1), + change: (parameter) => set(parameter), reset: () => set(0) }; }