From b246192a911435841a2cdca46907381ed23bb3dd Mon Sep 17 00:00:00 2001 From: nazar-lazarchuk Date: Sun, 23 Jan 2022 22:16:39 +0200 Subject: [PATCH] [docs] 01-writable-stores: naming update, snake_case replaced to camelCase --- .../examples/07-stores/00-writable-stores/App.svelte | 10 +++++----- .../07-stores/00-writable-stores/Decrementer.svelte | 4 ++-- .../07-stores/00-writable-stores/Incrementer.svelte | 4 ++-- .../07-stores/00-writable-stores/Resetter.svelte | 4 ++-- .../examples/07-stores/00-writable-stores/stores.js | 2 +- .../08-stores/01-writable-stores/app-a/App.svelte | 10 +++++----- .../01-writable-stores/app-a/Decrementer.svelte | 2 +- .../01-writable-stores/app-a/Incrementer.svelte | 2 +- .../08-stores/01-writable-stores/app-a/Resetter.svelte | 2 +- .../08-stores/01-writable-stores/app-a/stores.js | 2 +- .../08-stores/01-writable-stores/app-b/App.svelte | 10 +++++----- .../01-writable-stores/app-b/Decrementer.svelte | 4 ++-- .../01-writable-stores/app-b/Incrementer.svelte | 4 ++-- .../08-stores/01-writable-stores/app-b/Resetter.svelte | 4 ++-- .../08-stores/01-writable-stores/app-b/stores.js | 2 +- .../tutorial/08-stores/01-writable-stores/text.md | 8 ++++---- 16 files changed, 37 insertions(+), 37 deletions(-) diff --git a/site/content/examples/07-stores/00-writable-stores/App.svelte b/site/content/examples/07-stores/00-writable-stores/App.svelte index ee542f789d..7c04e439a3 100644 --- a/site/content/examples/07-stores/00-writable-stores/App.svelte +++ b/site/content/examples/07-stores/00-writable-stores/App.svelte @@ -1,17 +1,17 @@ -

The count is {count_value}

+

The counter is {counterValue}

diff --git a/site/content/examples/07-stores/00-writable-stores/Decrementer.svelte b/site/content/examples/07-stores/00-writable-stores/Decrementer.svelte index 043b795047..2456344c56 100644 --- a/site/content/examples/07-stores/00-writable-stores/Decrementer.svelte +++ b/site/content/examples/07-stores/00-writable-stores/Decrementer.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/examples/07-stores/00-writable-stores/Incrementer.svelte b/site/content/examples/07-stores/00-writable-stores/Incrementer.svelte index 2b5763012b..8274287742 100644 --- a/site/content/examples/07-stores/00-writable-stores/Incrementer.svelte +++ b/site/content/examples/07-stores/00-writable-stores/Incrementer.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/examples/07-stores/00-writable-stores/Resetter.svelte b/site/content/examples/07-stores/00-writable-stores/Resetter.svelte index 4183421e51..8882e35d57 100644 --- a/site/content/examples/07-stores/00-writable-stores/Resetter.svelte +++ b/site/content/examples/07-stores/00-writable-stores/Resetter.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/examples/07-stores/00-writable-stores/stores.js b/site/content/examples/07-stores/00-writable-stores/stores.js index 143e0c99f0..cdd10e573b 100644 --- a/site/content/examples/07-stores/00-writable-stores/stores.js +++ b/site/content/examples/07-stores/00-writable-stores/stores.js @@ -1,3 +1,3 @@ import { writable } from 'svelte/store'; -export const count = writable(0); \ No newline at end of file +export const counter = writable(0); \ No newline at end of file diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte index f2a4023f25..802ccc5da3 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte +++ b/site/content/tutorial/08-stores/01-writable-stores/app-a/App.svelte @@ -1,17 +1,17 @@ -

The count is {count_value}

+

The counter is {counterValue}

diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-a/Decrementer.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-a/Decrementer.svelte index 9bd4422f49..3e1041b7ff 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-a/Decrementer.svelte +++ b/site/content/tutorial/08-stores/01-writable-stores/app-a/Decrementer.svelte @@ -1,5 +1,5 @@ -

The count is {count_value}

+

The counter is {counterValue}

diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/Decrementer.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-b/Decrementer.svelte index 043b795047..2456344c56 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-b/Decrementer.svelte +++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/Decrementer.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/Incrementer.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-b/Incrementer.svelte index 2b5763012b..8274287742 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-b/Incrementer.svelte +++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/Incrementer.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/Resetter.svelte b/site/content/tutorial/08-stores/01-writable-stores/app-b/Resetter.svelte index 4183421e51..8882e35d57 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-b/Resetter.svelte +++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/Resetter.svelte @@ -1,8 +1,8 @@ diff --git a/site/content/tutorial/08-stores/01-writable-stores/app-b/stores.js b/site/content/tutorial/08-stores/01-writable-stores/app-b/stores.js index 143e0c99f0..cdd10e573b 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/app-b/stores.js +++ b/site/content/tutorial/08-stores/01-writable-stores/app-b/stores.js @@ -1,3 +1,3 @@ import { writable } from 'svelte/store'; -export const count = writable(0); \ No newline at end of file +export const counter = writable(0); \ No newline at end of file diff --git a/site/content/tutorial/08-stores/01-writable-stores/text.md b/site/content/tutorial/08-stores/01-writable-stores/text.md index 247ef86e8d..a6f3669100 100644 --- a/site/content/tutorial/08-stores/01-writable-stores/text.md +++ b/site/content/tutorial/08-stores/01-writable-stores/text.md @@ -4,15 +4,15 @@ title: Writable stores Not all application state belongs inside your application's component hierarchy. Sometimes, you'll have values that need to be accessed by multiple unrelated components, or by a regular JavaScript module. -In Svelte, we do this with *stores*. A store is simply an object with a `subscribe` method that allows interested parties to be notified whenever the store value changes. In `App.svelte`, `count` is a store, and we're setting `count_value` in the `count.subscribe` callback. +In Svelte, we do this with *stores*. A store is simply an object with a `subscribe` method that allows interested parties to be notified whenever the store value changes. In `App.svelte`, `counter` is a store, and we're setting `counterValue` in the `counter.subscribe` callback. -Click the `stores.js` tab to see the definition of `count`. It's a *writable* store, which means it has `set` and `update` methods in addition to `subscribe`. +Click the `stores.js` tab to see the definition of `counter`. It's a *writable* store, which means it has `set` and `update` methods in addition to `subscribe`. Now go to the `Incrementer.svelte` tab so that we can wire up the `+` button: ```js function increment() { - count.update(n => n + 1); + counter.update(n => n + 1); } ``` @@ -22,6 +22,6 @@ Finally, in `Resetter.svelte`, implement `reset`: ```js function reset() { - count.set(0); + counter.set(0); } ```