The WritableStreamDefaultController
interface of the Streams API represents a controller allowing control of a WritableStream
's state. When constructing a WritableStream
, the underlying sink is given a corresponding WritableStreamDefaultController
instance to manipulate.
None. WritableStreamDefaultController
instances are created automatically during WritableStream
construction.
const writableStream = new WritableStream({
start(controller) {
controller.error("My stream is broken");
},
write(chunk, controller) {
},
close(controller) {
},
abort(err) {
},
});