An open API service indexing awesome lists of open source software.

https://github.com/timarney/async-patterns

collection of ways to use async await
https://github.com/timarney/async-patterns

Last synced: 5 months ago
JSON representation

collection of ways to use async await

Awesome Lists containing this project

README

          

# async-patterns

# Async Await Promise All Array Destructuring
```javascript
const getBook = async bookName => {
const book = await fetchBook(bookName);

const [author, rating] = await Promise.all([
fetchAuthor(book.authorId),
fetchRating(book.id)
]);

return {
...book,
author,
rating
};
};
```
Reference: https://www.dalejefferson.com/blog/async-await-promise-all-array-destructuring/