Re: [whatwg/encoding] Add Streams support (#72)

> * new TextEncoder() and if you mix usages weird things happen
Maybe we don't even prevent decode/encode usage based on locked status at all? They're just two totally separate APIs, which don't impact each other in the slightest, that live on the same object.

I hadn't thought of the idea of having totally separate state for the APIs. I don't know how I feel about it. With my implementer hat on, it's easy to do. With my standard-writer hat on it feels a little awkward. From the perspective of a consumer of the API it's near-perfect -- you'd have to go out of your way to notice anything weird going on.

> * TextEncoder.stream() and things are clearly separate

This was what I was leaning towards. Not adding weirdness to the TextEncoder object appeals to me.

I'd really like to hear some other voices. If helps I can implement both alternatives in the prollyfill so that there's something concrete to look at.

-- 
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/encoding/issues/72#issuecomment-368753604

Received on Tuesday, 27 February 2018 05:39:01 UTC