- From: Adam Rice <notifications@github.com>
- Date: Thu, 15 Sep 2016 21:47:11 -0700
- To: whatwg/streams <streams@noreply.github.com>
Received on Friday, 16 September 2016 04:47:40 UTC
Currently methods of the transformer object are passed individual parameters for each action they can take. For example, the transform method is called like this:
```javascript
transform(chunk, done, enqueue, closeReadable, error)
```
where `done`, `enqueue`, `closeReadable` and `error` are all functions that `transform()` can call in processing `chunk`.
For consistency with ReadableStream and WritableStream, it would be better if the methods were passed a controller object. The definition would be something like
```javascript
class TransformStreamDefaultController {
constructor(stream)
done()
enqueue(chunk)
closeReadable()
error()
}
```
In a Promise-based implementation `done()` and `error()` would go away.
Then the signature of `transform()` would change to
```javascript
transform(chunk, controller)
```
--
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/518
Received on Friday, 16 September 2016 04:47:40 UTC