ReadableStreamDefaultController

The ReadableStreamDefaultController interface of the Streams API represents a controller allowing control of a ReadableStream's state and internal queue.

MDN Reference

Properties

Link copied to clipboard

The desiredSize read-only property of the ReadableStreamDefaultController interface returns the desired size required to fill the stream's internal queue.

Functions

Link copied to clipboard
fun close()

The close() method of the ReadableStreamDefaultController interface closes the associated stream.

Link copied to clipboard
fun enqueue(chunk: R = definedExternally)

The enqueue() method of the ReadableStreamDefaultController interface enqueues a given chunk in the associated stream.

Link copied to clipboard
fun error(error: JsError = definedExternally)

The error() method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.