Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help clarify instructions #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mischa-s
Copy link

@mischa-s mischa-s commented May 4, 2017

Move //your pull-stream reader... down a line to make it more clear

...when I did this exercise I spent a bunch of time trying to figure why the code I thought should be inside the read function was supposed to be before it but not working, until I said fuck it and put it where I thought it should go and then it just worked.

@dominictarr
Copy link
Member

I'm not sure that this really makes it more clear. what code were you putting where?
the function that takes read is the reader

@mischa-s
Copy link
Author

mischa-s commented May 8, 2017

Based on how I read it I was trying many variations of:

return function (read) {
     if (end) return cb()
       console.log(data)
       read(null, next)
    read(null, function next (end, data) {
 })

...because the line that I have now moved down seemed to suggest that the function was supposed to be above (i.e. in the place where the comment was)

@dominictarr
Copy link
Member

what do you think you would have done if there had been no comment,
or it was more incomplete like

return function (read) {
    read(null, ...)
 })

you must have gotten lots of errors about data and end and cb being undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants