WritableStreamDefaultWriter: closed プロパティ
closed
は WritableStreamDefaultWriter
インターフェイスの読み取り専用プロパティで、ストリームが閉じられた場合、またはライターのロックが解除された場合に満たし、ストリームがエラーの場合に拒否する Promise
を返します。
値
Promise
です。
例
js
const writableStream = new WritableStream(
{
start(controller) {},
write(chunk, controller) {
// ...
},
close(controller) {
// ...
},
abort(err) {
// ...
},
},
queuingStrategy,
);
// ...
const writer = writableStream.getWriter();
// ..
// ストリームが閉じているかどうかを確認します
writer.closed.then(() => {
console.log("writer closed");
});
仕様書
Specification |
---|
Streams # ref-for-default-writer-closed② |
ブラウザーの互換性
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.