8000 Update state-management.md by adamwirth · Pull Request #2486 · vuejs/v2.vuejs.org · GitHub
[go: up one dir, main page]

Skip to content

Update state-management.md #2486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/v2/guide/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Now whenever `sourceOfTruth` is mutated, both `vmA` and `vmB` will update their
To help solve this problem, we can adopt a **store pattern**:

``` js
var store = {
const store = {
debug: true,
state: {
message: 'Hello!'
Expand All @@ -56,14 +56,14 @@ Notice all actions that mutate the store's state are put inside the store itself
In addition, each instance/component can still own and manage its own private state:

``` js
var vmA = new Vue({
const vmA = new Vue({
data: {
privateState: {},
sharedState: store.state
}
})

var vmB = new Vue({
const vmB = new Vue({
data: {
privateState: {},
sharedState: store.state
Expand Down
0