Skip to content

Commit

Permalink
Update for readable stream spec changes
Browse files Browse the repository at this point in the history
Readable stream transitioned from .ready + sync .read() to async .read() in whatwg/streams#296. This PR updates the examples to use this new API.

It also removes a lot of trailing whitespace. The diff might be best viewed without whitespace tracked.
  • Loading branch information
domenic committed Mar 25, 2015
1 parent 12e8093 commit acc3393
Showing 1 changed file with 1,408 additions and 1,418 deletions.
Loading

5 comments on commit acc3393

@ClaesNilsson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR to update the TCP and UDP Socket API to be in sync with the latest version of the Streams API. I have one comment. Looking at the Streams API I would have expected that the read() method should be used on the ReadableStreamReader object, not the ReadableStream object according to the examples in the Streams API specification. So why not:
const reader = mySocket.readable.getReader();
reader.read().then(({ value, done }) => {.............

@domenic
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, you're totally right. Sorry about that! I'll update today.

@domenic
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated!

@ClaesNilsson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fine! However, I can't see the updated version. There is just one commit on this PR.

@ClaesNilsson
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forget about my comment above. I found your latest changes looking at the whole file. Sometimes Git confuses me :-). I have now merged the PR.

Please sign in to comment.