ReadableStreamDefaultController
The ReadableStreamDefaultController interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue. Default controllers are for streams that are not byte streams.
Type Parameters
| Type Parameter | Default type |
|---|---|
R | any |
Methods
close()
close(): void;
The close() method of the ReadableStreamDefaultController interface closes the associated stream.
Returns
void
enqueue()
enqueue(chunk): void;
The enqueue() method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.
Parameters
| Parameter | Type |
|---|---|
chunk | R |
Returns
void
error()
error(e?): void;
The error() method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.
Parameters
| Parameter | Type |
|---|---|
e? | any |
Returns
void
Properties
desiredSize
readonly desiredSize: number | null;
The desiredSize read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.