Skip to content

Commit

Permalink
Make example look more like the API it references.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ivar committed Jul 10, 2024
1 parent aa5cf91 commit a745d0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -7459,13 +7459,15 @@ readable and writable streams represent the two ends of a longer pipeline, with
web developer code insert [=transform streams=] into the middle of them.

<div class="example" id="example-endpoint-pair-usage">
Assuming we had a web-platform-provided interface `Transformer` that had `readable` and
`writable` attributes, web developers would write code like so:
Assuming a web-platform-fired "transform" event with a `transformer` attribute that is a
`Transformer` interface with `readable` and `writable` attributes, web developers would
write code like so:

<xmp highlight="js">
async function handleTransformer({readable, writable}) {
addEventListener("transform", ({transformer}) => {
const {readable, writable} = transformer;
await readable.pipeThrough(new TransformStream(...)).pipeTo(writable);
}
});
</xmp>
</div>

Expand Down

0 comments on commit a745d0c

Please sign in to comment.