Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

refactor: use fetch for ipfs.cat #1101

Merged
merged 2 commits into from
Sep 17, 2019
Merged

refactor: use fetch for ipfs.cat #1101

merged 2 commits into from
Sep 17, 2019

Conversation

alanshaw
Copy link
Contributor

No description provided.

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
//
// If the body in the clone is not consumed or destroyed the highwater mark
// will be reached (for large payloads) and stop the real body from flowing.
if (isNode) response.body.destroy()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This...sucks...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ky has some, uh, interesting caveats.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
Copy link
Collaborator

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/cat.js Show resolved Hide resolved
src/cat.js Show resolved Hide resolved
for await (const chunk of toIterable(res.body)) {
yield Buffer.from(chunk)
}
})()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a IIEF ?

Copy link
Contributor Author

@alanshaw alanshaw Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its a generator function that needs to be called to obtain the generator. I can split this out into a definition and a return of the called function if you think it’ll be easier to understand?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants