Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This example has been simplified a bit too much I think. It talks about a platform-provided
Transformer
interface but that interface is now super-implicit, because of the destructuring of function arguments. I think reverting to something likewould work better.
Additionally, the point of
createEndpointPair()
was to match the official name given in the standard, "endpoint pair". So I think that that was even better.Can you say more about why you changed this example?
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.
I read "web-platform-provided function
createEndpointPair()
" as a callout to the same-shapedsender.createEncodedStreams()
method removed in w3c/webrtc-encoded-transform#64.I was trying to maintain this similarity to the API it's referencing. But the spec's worker-only API is different. From MDN and blog post examples:
The spec fires an event with the transformer which has no constructor. The event part seemed unnecessary but I can try to add it if the context is useful.
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.
Sorry, this seems to have gone in the opposite direction of what I'm requesting. The point of this example is not to reference any other API. (That's the purpose of the note below, which you helpfully edited for accuracy.) It's to give an example of the simplest possible concept of an endpoint pair, i.e. a platform-provided API that returns a
{ readable, writable }
object.The naming is especially important, as we're trying to illustrate the "endpoint pair" concept defined above, not some sort of "transformer" concept which this document does not define.
Can you revert it to its previous version?