- From: guest271314 <notifications@github.com>
- Date: Thu, 22 Mar 2018 09:38:47 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 22 March 2018 16:39:09 UTC
The specification currently states > The [`WritableStream()`](https://streams.spec.whatwg.org/#ws-constructor) constructor accepts as its first argument a JavaScript object representing the [underlying sink](https://streams.spec.whatwg.org/#underlying-sink). We can define a method at the JavaScript object passed to `WritableStream()` constructor ``` let WSController = class { constructor(/* data */) { this.bytesSoFar = 0; } progress(controller) { console.log(controller, this.bytesSoFar); } start(controller) { console.log(controller); } write(data, controller) { this.progress(controller, ++this.bytesSoFar); } } .. let wscontroller = new WSController(); let writableStream = new WritableStream(wscontroller); ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/876#issuecomment-375373268
Received on Thursday, 22 March 2018 16:39:09 UTC