Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
peet86 authored Oct 5, 2023
1 parent 95a5d6d commit 0c29202
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,11 @@ By default returns with the total price:
total()
// 220
```
or you can pass a custom reducer function to have full control over the calculation.
or you can pass a custom reducer function to summarize other attributes, like product quantity:

```javascript
total((sum, product) => (sum += product.quantity), 0)
```

#### destroy()

Expand Down

0 comments on commit 0c29202

Please sign in to comment.