RE: Idiomatic representation of { buffer, bytesRead }

Thanks very much for the feedback Jason!


> But you can support both, like this:
> 
>     pull(DataView) -> Promise<DataView>
>     pull(TypedArrayView) -> Promise<TypedArrayView of the same type>
> 
> A view argument conveniently provides just the three pieces of information
> you need, plus a type.

I thought of that. However, I found it a bit strange that passing this function a view onto bytes [256, 512] of a 1024-byte buffer would detach the entire 1024-byte buffer. What do you think?

Received on Wednesday, 4 March 2015 21:07:26 UTC