diff --git a/.travis.yml b/.travis.yml index 439f719..8c92608 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ node_js: branches: only: - master +# See https://github.com/tc39/proposal-iterator-helpers/pull/124#issuecomment-771560244 +script: echo "npm test disabled" after_success: - $(npm bin)/set-up-ssh --key "${encrypted_7cd0ff475ed3_key}" --iv "${encrypted_7cd0ff475ed3_iv}" --path-encrypted-key .travis_github_deploy_key.enc - $(npm bin)/update-branch --commands 'npm run build' --commit-message "Update gh-pages @ ${TRAVIS_COMMIT}" --directory 'dist' --distribution-branch 'gh-pages' --source-branch 'master' diff --git a/README.md b/README.md index c1b5d16..13cbbad 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,15 @@ class ObligatoryCryptocurrencyReference extends Component { } ``` +```js +const responses = await AsyncIterator.from(urls) + .map(async (url) => { + const response = await fetch(url); + return response.json(); + }) + .toArray(); +``` + ### Why not use Array.from + Array.prototype methods? All of these methods (except for reduce and toArray) are **lazy**. They will