New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Res stream example #1270
Res stream example #1270
Conversation
Todos before merging (I will do):
|
c466fac
to
bed6f6d
Compare
Looks cool! Definitely a great idea for an example. |
A more detailed example rejecting any responses that are not `200`s: | ||
|
||
```js | ||
var http = require('http') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what value this code block adds, it seems very confusing, especially to a newbie. Could you distill this down to a single, smaller concept?
One thing that I remember I struggled with was how the 'response' event could work with piping. And how you could listen to the 'response' event to make whatever changes you needed to make and thennnn pipe it. It would be nice to explain how the 'response' event and 'piping' can be used together. |
- inlined the image to not have any deps, too weird? :\
thanks @FredKSchott. added a couple commits:
i'm unclear on a couple things:
happy to remove either/or/both/etc. -- any further thoughts after your initial pass reviewing? now we're at three examples, so culling this down a bit is +1 on my end. let me know which/if any we'd like to keep! |
grrr -- i am now TOTALLY clear on your comments @FredKSchott. was reading them out of order. let's definitely remove the longer of the two original examples -- take a look at this third and see if you'd like to keep. got it. sorry for confusion. 馃幈 |
I like it, although there's a lot going on there. The user has to understand what the content type header is, how the mime module works, etc. Is there a way we could make that example simpler, without as many dependencies? Also, the headers should explain the concept you're trying to introduce / give an example of, rather than the specifics of that example. A user looking for help with content types could want advice on 1000s of things, not just piping. Love the extra resources though! Just remember to keep them simple, and understandable to as newbie of a person as possible. |
thanks, @FredKSchott. do you have something else in mind that you might be able to point me in the right direction? the mime example is something i've personally used in the past, so that's why its there 馃挜 the intent was to react to your feedback:
this PR currently contains three examples:
any / all / none -- we can close this if they're not hitting the mark. that's just fine. appreciate the input thus far. if you have some other direction, happy to update -- otherwise not sure how much further i can take this swinging blindly. let me know! |
Hey @tbuchok, sorry for leaving you hanging with this PR. I'm not sure if you're still interested in pushing this through, but I'd love to get it in. If you still are, here is what I would need to merge: Each section/example should have a single purpose, usually to introduce 1 concept. So for a simple example of what I mean: your first example introduces the idea of listening for the Another example: Your entire second code block is very overwhelming, even for me. What is your purpose for including it (what 1 concept do you want someone to learn from reading it) and whats the fewest number of lines you can convey that concept in? |
agreed it's overwhelming. let's close and re-eval. there's mega discussions on docs right now, let's see where that lands and we can wiggle a couple smaller examples into place when ready. thanks again for the review, fred. |
@tbuchok Understood, thanks for taking the time! |
this build off the previous PR #1269