Skip to content

Commit 97f4a6f

Browse files
committed
chore: add section about text streaming to the README
1 parent 5fd8f3e commit 97f4a6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ fetch('https://jsonplaceholder.typicode.com/todos/1')
5151
```
5252

5353
Check fetch's [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to learn more about the concepts and extended usage.
54+
55+
### Enable text streaming
56+
57+
A non-standard option was added to `fetch` to enable incremental events in React Native's networking layer.
58+
59+
```js
60+
fetch('https://jsonplaceholder.typicode.com/todos/1', { reactNative: { textStreaming: true } })
61+
.then(response => response.body)
62+
.then(stream => ...)
63+
```
5464
### Aborting requests
5565

5666
It's possible to [abort an on-going request](https://developers.google.com/web/updates/2017/09/abortable-fetch) and React Native already supports [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController), so there is no need for a polyfill.

0 commit comments

Comments
 (0)