Open greim opened 8 years ago
@mitchhentges @sholladay @nerdbeere thoughts?
That seems way more flexible than before, so it sounds good to me! Looking forward to nerdbeere and sholladay's input, though.
It certainly is flexible. And that is an excellent use of yield
, which is pretty cool.
As for the example, I'm inclined to think that hoxy should be responsible for complying with the HTTP spec for the most part and I shouldn't have to worry about implementing that. I'm sure there are other awesome use cases, though. The only other hangup for me is that, to my eyes, this exacerbates the confusion I tried to describe in #72 related to what the request/response actually represents.
In the example, when you do response.fromServer()
, you're not really going to have access to the response from the server, but instead a potentially mutated copy populated with stuff for the client. The kinds of proxies described in #48 benefit a lot from that distinction being clear and fluent.
Idea: add a "phaseless" feature which would allow you to do:
This would allow handling errors that happen between phases within the scope of an intercept, which currently isn't possible. Example: