Skip to content

Commit

Permalink
Update docs/docs/api/Dispatcher.md
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Nagy <ronagy@icloud.com>
  • Loading branch information
Uzlopak and ronag authored Oct 17, 2024
1 parent c647f36 commit 0cfd421
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions docs/docs/api/Dispatcher.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,18 +641,13 @@ const { body, statusCode } = await client.request({
method: 'GET'
})

body.on('error', console.error) // prevent process from crashing on error

if (statusCode === 200) {
const buffer = await body.arrayBuffer()
return buffer
return await body.arrayBuffer()
}

for await (const _chunk of body) {
// force consumption of body to avoid memory leak
}
await body.dump()

return null
```

### `Dispatcher.stream(options, factory[, callback])`

Expand Down

0 comments on commit 0cfd421

Please # to comment.