Baseline Widely available
Note: This feature is available in Web Workers.
The enqueue()
method of the TransformStreamDefaultController
interface enqueues the given chunk in the readable side of the stream.
For more information on readable streams and chunks see Using Readable Streams.
Syntax Parameterschunk
The chunk being queued. A chunk is a single piece of data. It can be any type of data, and a stream can contain chunks of different types.
None (undefined
).
TypeError
The stream is not readable. This might occur if the stream is errored via controller.error()
, or when it is closed without its controller's controller.close()
method ever being called.
In this example an encoded chunk is passed to the queue using the enqueue()
method.
const textEncoderStream = new TransformStream({
transform(chunk, controller) {
controller.enqueue(new TextEncoder().encode(chunk));
},
flush(controller) {
controller.terminate();
},
});
Specifications Browser compatibility
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4