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

Handle case where body is undefined in React Native env #3

Closed
pcowgill opened this issue Jan 28, 2020 · 5 comments
Closed

Handle case where body is undefined in React Native env #3

pcowgill opened this issue Jan 28, 2020 · 5 comments

Comments

@pcowgill
Copy link

Now that js-ipfs-http-client uses the source file in this lib, some elements from this PR ipfs-inactive/js-ipfs-http-client#1224 will need to land here instead

@pcowgill pcowgill changed the title Handle React Native case where body is undefined Handle case where body is undefined in React Native env Jan 28, 2020
@pcowgill
Copy link
Author

@alanshaw For js-ipfs-http-client to work well with this repo in React Native, I was thinking of opening a PR here that would handle the case where res.body is undefined, it involves passing a whole fetch response into this helper rather than just the readable. Should we make a variant of the function that accepts the whole response so as not to break js-ipfs-utils and js-ipfs? Make a new repo called response-to-it? Other? Thanks!

I'm pcowgill on Telegram if you would like to chat semi-synchronously about this. Thanks!

cc @hugomrdias

@pcowgill
Copy link
Author

@alanshaw This is how it was going to look in js-ipfs-http-client before I realized that helper lib was being extracted out into a shared package https://github.com/pcowgill/js-ipfs-http-client/blob/74c286ed08862fc7775a2f5ba51a44248faebcef/src/lib/stream-to-async-iterable.js

@pcowgill
Copy link
Author

@alanshaw I'm going with this strategy for now so as to have minimal impact on js-ipfs and js-ipfs-utils https://github.com/pcowgill/js-ipfs-http-client/blob/250848946b59bd804894134ed0b0829211c28de6/src/lib/stream-to-async-iterable.js

@hugomrdias
Copy link

this package doesn't care about web Response or Response.body only streams.
IMO this issue should be handled elsewhere.

@alanshaw
Copy link
Owner

@alanshaw I'm going with this strategy for now so as to have minimal impact on js-ipfs and js-ipfs-utils https://github.com/pcowgill/js-ipfs-http-client/blob/250848946b59bd804894134ed0b0829211c28de6/src/lib/stream-to-async-iterable.js

Agree this is the better way to go, the fix does not belong here.

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

No branches or pull requests

3 participants