Web APIs
WritableStreamDefaultWriter.closed
Promise that fulfills when the associated stream closes, or rejects if it errors or the writer releases its lock before closure.
Formal Syntax & Structure
javascript syntaxjavascript
writer.closedReturn Value
Promise<void>
Closure promise.
Working Example
Example Snippetjavascript
(async()=>{const w=new WritableStream().getWriter(); const done=w.closed; await w.close(); await done; console.log("closed"); w.releaseLock();})()