Re: [whatwg/streams] read all bytes usage/signature may be hard to understand (Issue #1315)

This algorithm is using the "single sentence" format, as specified [here](https://infra.spec.whatwg.org/#algorithm-declaration) (see: "Very short algorithms...").

However, I agree that as soon as the types of those arguments become complex (e.g. another algorithm taking arguments of its own), this becomes difficult to parse.

How about we put the (single) step in a numbered list below the algorithm?
> To **read all bytes** from a [`ReadableStreamDefaultReader`](https://streams.spec.whatwg.org/#readablestreamdefaultreader) _reader_, given _successSteps_, which is an algorithm accepting a [byte sequence](https://infra.spec.whatwg.org/#byte-sequence), and _failureSteps_, which is an algorithm accepting a JavaScript value:
> 1. [Read-loop](https://streams.spec.whatwg.org/#read-loop) given _reader_, a new [byte sequence](https://infra.spec.whatwg.org/#byte-sequence), _successSteps_, and _failureSteps_.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1315#issuecomment-2127461912
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1315/2127461912@github.com>

Received on Thursday, 23 May 2024 15:46:34 UTC