Skip to content

Commit 1ff6a24

Browse files
authored
Fix minor errors in README.md
Changes involve: - Removal of dead links: data flow.png and vuex.png - Removal of discourse markers (although, also, in addition) to make sentences precise
1 parent 0e109e2 commit 1ff6a24

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

docs/README.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,13 @@ new Vue({
3131

3232
It is a self-contained app with the following parts:
3333

34-
- The **state**, which is the source of truth that drives our app;
35-
- The **view**, which is just a declarative mapping of the **state**;
36-
- The **actions**, which are the possible ways the state could change in reaction to user inputs from the **view**.
34+
- The **state**, the source of truth that drives our app;
35+
- The **view**, a declarative mapping of the **state**;
36+
- The **actions**, the possible ways the state could change in reaction to user inputs from the **view**.
3737

38-
This is an extremely simple representation of the concept of "one-way data flow":
38+
This is an simple representation of the concept of "one-way data flow":
3939

40-
<p style="text-align: center; margin: 2em">
41-
<img style="width:100%;max-width:450px;" src="/flow.png">
42-
</p>
43-
44-
However, the simplicity quickly breaks down when we have **multiple components that share common state**:
40+
However, the simplicity quickly breaks down when we have **multiple components that share a common state**:
4541

4642
- Multiple views may depend on the same piece of state.
4743
- Actions from different views may need to mutate the same piece of state.
@@ -50,17 +46,15 @@ For problem one, passing props can be tedious for deeply nested components, and
5046

5147
So why don't we extract the shared state out of the components, and manage it in a global singleton? With this, our component tree becomes a big "view", and any component can access the state or trigger actions, no matter where they are in the tree!
5248

53-
In addition, by defining and separating the concepts involved in state management and enforcing certain rules, we also give our code more structure and maintainability.
49+
By defining and separating the concepts involved in state management and enforcing rules that maintain independece between views and states, we give our code more structure and maintainability.
5450

5551
This is the basic idea behind Vuex, inspired by [Flux](https://facebook.github.io/flux/docs/overview.html), [Redux](http://redux.js.org/) and [The Elm Architecture](https://guide.elm-lang.org/architecture/). Unlike the other patterns, Vuex is also a library implementation tailored specifically for Vue.js to take advantage of its granular reactivity system for efficient updates.
5652

5753
If you want to learn Vuex in an interactive way you can check out this [Vuex course on Scrimba](https://scrimba.com/g/gvuex), which gives you a mix of screencast and code playground that you can pause and play around with anytime.
5854

59-
![vuex](/vuex.png)
60-
6155
### When Should I Use It?
6256

63-
Although Vuex helps us deal with shared state management, it also comes with the cost of more concepts and boilerplate. It's a trade-off between short term and long term productivity.
57+
Vuex helps us deal with shared state management with the cost of more concepts and boilerplate. It's a trade-off between short term and long term productivity.
6458

6559
If you've never built a large-scale SPA and jump right into Vuex, it may feel verbose and daunting. That's perfectly normal - if your app is simple, you will most likely be fine without Vuex. A simple [store pattern](https://vuejs.org/v2/guide/state-management.html#Simple-State-Management-from-Scratch) may be all you need. But if you are building a medium-to-large-scale SPA, chances are you have run into situations that make you think about how to better handle state outside of your Vue components, and Vuex will be the natural next step for you. There's a good quote from Dan Abramov, the author of Redux:
6660

0 commit comments

Comments
 (0)