New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Guideline] Where to factor out logic #437
Comments
So, my guidelines have been mainly:
The "Readable Stream Abstract Operations Used by Controllers" separation also drives things somewhat. Hope this helps? |
Thanks, Domenic. The main motivation of this was to record reasoning we made for determining listed in your "This covers skipping brand checking, ..." sentence. I'd like to keep guidelines like this here. Which do you prefer, committing to the repo as an MD file, an open issue, a closed issue, ... |
I will work on a Markdown file that encompasses this and other things we've talked about in the past. |
I'd like to write down a clear well-discussed guidance for at which point we factor out logic and for what purpose.
ReadableStreamAddReadIntoRequest()
(ones listed in the block with the comment "// ReadableStream API exposed for controllers")if (IsReadableStream(this) === false)
block inReadableStream.getReader()
read(view)
with non typed arrayview
AcquireReadableStreamBYOBReader()
directly than callinggetReader()
(only when the user is sure that it's byte stream)ReadableStreamDefaultReaderRead()
directly than callingread()
ReadableStreamDefaultReaderRead()
checksstream._state
in itself as it's less common that the user is sure in which state the stream is.ReadableStreamDefaultControllerClose()
directly than callingclose()
. The user can know unsolicited closure by listening to cancel() call on the underlying source.ReadableStreamTee()
directly than callingtee()
The text was updated successfully, but these errors were encountered: