fetch
fetch copied to clipboard
A fetch API polyfill for React Native with text streaming support.
I'll circle back with a reproduction shortly.
I believe React Native's environment does not provide [`DOMException`](https://developer.mozilla.org/en-US/docs/Web/API/DOMException), so we need to use a polyfill ~~or develop our own~~. Check [domexpection](https://github.com/jsdom/domexception). If that's the case, for consistency's sake, the...
It should be possible to rewrite the code to not rely on both [TextEncoder](https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder) and [TextDecoder](https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder), just like GitHub as done: - Decode: https://github.com/github/fetch/blob/a8aa427de0ed808ff26c0e3eb2e59c122c44488a/test/test.js#L79 - Encode: https://github.com/github/fetch/blob/a8aa427de0ed808ff26c0e3eb2e59c122c44488a/test/test.js#L69 By removing the...
The [ReadableStreamDefaultReader](https://streams.spec.whatwg.org/#default-reader-constructor) instance returned by `Response.prototype.body.getReader` is not being terminated with an error when a network error happens. According to the Streams whatwg spec, the `reader` returned by `body` should...
**首先感谢该项目的所有开源贡献者** 环境: - React-Native 0.75 - Expo 51 **先说为什么还是选择了fetch**:rn-sse、event-source 同样是非常优秀的开源项目,但是不太满足我的HttpRequest需求,以及EventSource会使我的Markdown混乱,我无法解决。 _在我尝试了 axion、websocket、rn-sse、event-source 以及数个小时的调试和大量的翻译工作后,终于在这个项目中取得到了结果。_ 在各种论坛上徘徊后,我找到了该项目,以下是我最低限度的实践: 1. 我安装了文档中所有的依赖,并且在项目根目录创建了 index.js 这里有几个地方需要说明: `import { polyfill as polyfillReadableStream } from 'react-native-polyfill-globals/src/readable-stream';` `web-streams-polyfill/ponyfill/es6` 加载时会报错,于是我使用 `const {...