This is an experimental technologyCheck 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
None. WritableStreamDefaultController instances are created automatically during WritableStream construction.
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 |
| StreamsThe 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 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Chrome
Full support 58 |
Edge
Full support ≤18 |
Firefox
No support No |
IE
No support No |
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
Full support 7.0 |
| Chrome
? |
Edge
Full support 16 |
Firefox
No support No |
IE
No support No |
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.
WritableStreamDefaultController by Mozilla Contributors is licensed under CC-BY-SA 2.5.