XStream
XStream
Transform binary stream
Importimport{ XStream }from"@ant-design/x"; |
Sourcecomponents/x-stream |
ReadableStream
to Record
ReadableStream
Common ReadableStream
instances, such as await fetch(...).body
, usage example:
import { XStream } from '@ant-design/x';async function request() {const response = await fetch();// .....for await (const chunk of XStream({readableStream: response.body,})) {console.log(chunk);}}
Property | Description | Type | Default | Version |
---|---|---|---|---|
readableStream | Readable stream of binary data | ReadableStream<'Uint8Array'> | - | - |
transformStream | Support customizable transformStream to transform streams | TransformStream<string, T> | sseTransformStream | - |