Skip to content

ReadableStream bindings are incorrect #91

Description

@TheSpyder

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions