Skip to content

Commit 4f29ab5

Browse files
committed
tweak docs
1 parent 5c9a0a6 commit 4f29ab5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ import React from 'react'
4141
import { store, view } from 'react-easy-state'
4242

4343
const count = store({ num: 0 })
44-
const increment = () => count.num++
44+
const increment = () => counter.num++
4545

46-
export default view(() => (<button onClick={increment}>{count.num}</button>))
46+
export default view(() => (<button onClick={increment}>{counter.num}</button>))
4747
```
4848

4949
This is enough for it to automatically update your views when needed. It doesn't matter how you structure or mutate your state stores, any syntactically valid code works.
@@ -80,10 +80,7 @@ _You need npm 5.2+ to use npx._
8080
```js
8181
import { store } from 'react-easy-state'
8282

83-
const user = store({
84-
name: 'Rick'
85-
})
86-
83+
const user = store({ name: 'Rick' })
8784
// stores behave like normal JS objects
8885
user.name = 'Bob'
8986
```

0 commit comments

Comments
 (0)