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.
WritableStreamDefaultController()WritableStreamDefaultController object instance.WritableStreamDefaultController.error()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) {
...
}
}); | Specification | Status | Comment |
|---|---|---|
| Streams The definition of 'WritableStreamDefaultController' in that specification. | Living Standard | Initial definition. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 58 | Yes | No | ? | 45 | ? |
WritableStreamDefaultController() constructor
|
? | ? | ? | ? | ? | ? |
error
|
? | ? | ? | ? | ? | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | 58 | 58 | Yes | No | 45 | ? | ? |
WritableStreamDefaultController() constructor
|
? | ? | ? | ? | ? | ? | ? |
error
|
? | ? | ? | ? | ? | ? | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WritableStreamDefaultController