Re: [img-conversion] toBlob() Having two optional kinda sucks... let's merge them. (#13)

>  I specced ImageData's toBlob to return a Promise in anticipation of this, but I would be happy to include both the callback and promise form for complete consistently with canvas toBlob.

I would not be in favor of that. That would just be confusing. 

> The Request blob() method does use a slightly different name. I think we might be bikeshedding over this, but I feel it's OK to use different names, since toBlob() is used for a conversion from one thing to another, whereas blob() is used to obtain the request body in the first place.

The thing is, conceptually, just like fetch, we are requesting an operation to happen to something over time. The returned representation is really an operation that whose result may be a blob. However, what is being constructed is a stream that eventually results in a blob. 

This leads me to believe that returning a promise is wrong. We really want to return either a pure stream, or a sub-class of stream that you can call .blob() on, that returns a promise. 


---
Reply to this email directly or view it on GitHub:
https://github.com/WICG/img-conversion/issues/13#issuecomment-142690700

Received on Wednesday, 23 September 2015 18:33:58 UTC