Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for readable stream spec changes
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
acc3393
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.
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 theReadableStreamReader
object, not theReadableStream
object according to the examples in the Streams API specification. So why not:const reader = mySocket.readable.getReader();
reader.read().then(({ value, done }) => {.............
acc3393
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.
Oh wow, you're totally right. Sorry about that! I'll update today.
acc3393
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.
Updated!
acc3393
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.
Ok, fine! However, I can't see the updated version. There is just one commit on this PR.
acc3393
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.
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.