Re: [whatwg/streams] light weight transformations (#461)

@dominictarr, @ariutta: You can use `flatMap` / `concatMap` if you hide the remainder in transformer state, but then the transformer needs a flush / end handler as well. I do like the generality of `concatMap`, but went for the pragmatic solution of sticking the remainder handling in [a match transform wrapper](https://github.com/gwicke/mixmaster/blob/13518bc68644b0c71d6c57e72d2fad9fac02ed7a/index.js#L102), where it can be applied to different matchers.

Another interesting aspect of `flatMap` / `concatMap` is the ability to return a batch of values at once. This got me thinking about a `.readBatch()` method in the reader interface, which would return at least a single-element array, but possibly additional entries that might be available / buffered without blocking in the transform.

---
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/461#issuecomment-237151917

Received on Wednesday, 3 August 2016 06:17:38 UTC