You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The WritableStreamDefaultController
interface of the 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.
Constructor
WritableStreamDefaultController()
- Creates a new
WritableStreamDefaultController
object instance.
Properties
- None.
Methods
WritableStreamDefaultController.error()
- Causes any future interactions with the associated stream to error.
Examples
const writableStream = new WritableStream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('My stream is broken'); }, write(chunk, controller) { ... }, close(controller) { ... }, abort(err) { ... } });
Specifications
Specification | Status | Comment |
---|---|---|
Streams The definition of 'WritableStreamDefaultController' in that specification. |
Living Standard | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
WritableStreamDefaultController | Chrome Full support 58 | Edge Full support Yes | Firefox No support No | IE ? | Opera Full support 45 | Safari ? | WebView Android Full support 58 | Chrome Android Full support 58 | Firefox Android No support No | Opera Android Full support 43 | Safari iOS ? | Samsung Internet Android ? |
WritableStreamDefaultController() constructor | Chrome ? | Edge ? | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
error | Chrome ? | Edge Full support 16 | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.