- From: Andy Hume <notifications@github.com>
- Date: Tue, 15 Dec 2015 09:52:57 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
Received on Tuesday, 15 December 2015 17:53:36 UTC
I ended up implementing subtypes of the Headers class for each of the guard values. RequestHeaders, ResponseHeaders, etc... which set a private guard property in their constructors. Seems like a clean approach, but we'll see how this pans out as we implement Request/Response. The base class still relies on the internal guard property, but the APIs never have to worry about reading or writing these. @phuu made the point that eg. immutable headers throws a TypeError if you try to write to it. Could that be an indication that types are a good way to go here? --- Reply to this email directly or view it on GitHub: https://github.com/whatwg/fetch/issues/182#issuecomment-164838835
Received on Tuesday, 15 December 2015 17:53:36 UTC