Skip to content
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

ReadableStream bindings are incorrect #91

Open
TheSpyder opened this issue Jan 25, 2022 · 0 comments
Open

ReadableStream bindings are incorrect #91

TheSpyder opened this issue Jan 25, 2022 · 0 comments

Comments

@TheSpyder
Copy link
Owner

I'm not sure where the inspiration for the current bindings came from, but in them "byob" readers don't have a read method. This is not true:

https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultReader/read
https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamBYOBReader/read

They even return the same shape of object. BYOB readers are still experimental, I think we can flatten these bindings into a single Reader.t and it will work just fine (we also need to fix the return type of the read method).

Note that we'll probably have to use the same module rec trick to avoid creating a full nested module, this is a cool idea that we might be able to leverage elsewhere. Instead of var ModuleName = {} which tree shaking can't remove, it only generates var ModuleName which I would hope can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant