Skip to content

Commit

Permalink
Merge 994dd24 into 6753121
Browse files Browse the repository at this point in the history
  • Loading branch information
justbrody committed May 25, 2019
2 parents 6753121 + 994dd24 commit 8d53dee
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,32 @@ const App = withGlobalStore(() => (
</div>
))
```

## Store operation view/set/over

### Over
```javascript
const IncButton = connnect()(({ over }) => {
const inc = () => over(countLens, x => x + 1)

return <button onClick={inc}>Increment</button>
})
```

### Set
```javascript
const ResetButton = connnect()(({ set }) => {
const reset = () => set(countLens, 0)

return <button onClick={reset}>Reset</button>
})
```

### View
```javascript
const Counter = connnect()(({ view }) => {
const count = view(countLens)

return <div>{count}</di>v
})
```

0 comments on commit 8d53dee

Please sign in to comment.