Skip to content

Commit

Permalink
docs: fix example code formatting (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsky authored and aleclarson committed May 28, 2019
1 parent c8ecbad commit 65b9d08
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions readme.md
Expand Up @@ -199,17 +199,16 @@ console.dir([{}, {}, {}].map(mapper))
This mechanism can also nicely be leveraged to further simplify our example reducer:

```javascript
import produce from 'immer'
import produce from "immer"

const byId = produce((draft, action) => {
switch (action.type) {
case RECEIVE_PRODUCTS:
action.products.forEach(product => {
draft[product.id] = product
})
return
})
}
switch (action.type) {
case RECEIVE_PRODUCTS:
action.products.forEach(product => {
draft[product.id] = product
})
return
}
})
```

Expand Down

0 comments on commit 65b9d08

Please sign in to comment.