WritableStreamDefaultWriter: closed-Eigenschaft
Hinweis: Diese Funktion ist in Web Workers verfügbar.
Die schreibgeschützte closed
-Eigenschaft des
WritableStreamDefaultWriter
-Interfaces gibt ein
Promise
zurück, das erfüllt wird, wenn der Stream geschlossen wird, oder abgelehnt wird, wenn der Stream einen Fehler aufweist oder die Sperre des Writers freigegeben wird.
Wert
Ein Promise
.
Beispiele
js
const writableStream = new WritableStream(
{
start(controller) {},
write(chunk, controller) {
// ...
},
close(controller) {
// ...
},
abort(err) {
// ...
},
},
queuingStrategy,
);
// ...
const writer = writableStream.getWriter();
// ..
// check if the stream is closed
writer.closed.then(() => {
console.log("writer closed");
});
Spezifikationen
Specification |
---|
Streams # ref-for-default-writer-closed② |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
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.