Skip to content

Commit

Permalink
doc: tweak example
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin-Huang committed Dec 17, 2019
1 parent 826b9fe commit afb18c0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ Prray -- "Promisified" Array, compatible with normal array, but comes with async
```javascript
import Prray from 'prray'
const prr = Prray.from(['www.google.com', 'npmjs.org'])
const urls = Prray.from(['www.google.com', 'npmjs.org'])


const responses = await prr.mapAsync(fetch)
const responses = await urls.mapAsync(fetch)


// Async method chaining 🚀:

const htmls = await prr.mapAsync(fetch).mapAsync(r => r.text())
const htmls = await urls.mapAsync(fetch).mapAsync(r => r.text())


// Method chaining with async and common methods:

await prr
await urls
.map(commonFunc)
.sortAsync(asyncFunc)
.concat(['github.com', 'wikipedia.org'])
Expand All @@ -43,7 +43,7 @@ await prr

// Concurrency limit:

const responses = await prr.mapAsync(fetch, { concurrency: 10 })
const responses = await urls.mapAsync(fetch, { concurrency: 10 })
```

- [Install](#install)
Expand Down

0 comments on commit afb18c0

Please sign in to comment.