JavaScripture
Contribute via GitHub Feedback

WritableStreamSink : Object

Object that receives the sequence of values for a WritableStream. Passed to the WritableStream constructor. Any JavaScript object can be used as a writable stream sink. Any of the properties/method can be specified. If a property/method is not provided, the WritableStream will use a default behavior for the property/method.

Instance Methods

abort(reason : Object) : Promise<undefined>

Called when the stream is aborted.

Example:

Run

Results:

 

close() : Promise<undefined>

Called when the writer is closed.

Example:

Run

Results:

 

start(controller : WritableStreamDefaultController) : Object

Called when this is passed to a WritableStream constructor.

Example:

Run

Results:

 

write(chunk : Object, controller : WritableStreamDefaultController) : Promise<undefined>

Called each time a chunk is written to the stream.

Example:

Run

Results: