Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add iterator method to response #36

Merged
merged 2 commits into from
Apr 13, 2020

Conversation

achingbrain
Copy link
Member

Restores the previous .iterator method but on the response object similar to .ndjson:

const response = await http.get('http://...')

for await (const buf of response.iterator()) {
  // buf is a Buffer
}

Also adds a test for urlSource because it turns out it uses .iterator but was untested.

Restores the previous `.iterator` method but on the response object
similar to `.ndjson`:

```javascript
const response = await http.get('http://...')

for await (const buf of response.iterator()) {
  // buf is a Buffer
}
```
@achingbrain achingbrain requested a review from hugomrdias April 9, 2020 20:37
@hugomrdias hugomrdias merged commit 8f7c96c into master Apr 13, 2020
@hugomrdias hugomrdias deleted the fix/add-iterator-method-to-response branch April 13, 2020 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants