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

Will this use the FileReader to read? #2

Closed
PaulKinlan opened this issue Apr 4, 2016 · 6 comments
Closed

Will this use the FileReader to read? #2

PaulKinlan opened this issue Apr 4, 2016 · 6 comments

Comments

@PaulKinlan
Copy link

I would expect the API to prefer to use the File and FileReader API rather than a new custom read function.

@drufball
Copy link
Contributor

drufball commented Apr 6, 2016

I agree though that we'll want to reuse API's wherever possible. These are mostly just strawmen API ideas, rather than what I expect the final API to use. @inexorabletash @cmumford thoughts?

@kenchris
Copy link

kenchris commented Apr 7, 2016

Or maybe something like https://streams.spec.whatwg.org/#rs-class ReadableStream

@inexorabletash
Copy link
Member

I assume we'll use File if possible. And while I'd love File to grow more usable reading methods like Request/Response's Body that's probably out of scope, so I would assume File/FileReader are there.

@inexorabletash
Copy link
Member

One plausible API sketch is here: https://gist.github.com/petkaantonov/37a9c64ea2bbd1aa3ca5

@addyosmani
Copy link

I assume we'll use File if possible. And while I'd love File to grow more usable reading methods like Request/Response's Body that's probably out of scope, so I would assume File/FileReader are there.

This sounds like a reasonable start to me.

@mkruisselbrink
Copy link
Contributor

Current proposal does in fact use File/FileReader for reading. That already gives you somewhat hacky integration with ReadableStreams (i.e. you can wrap a File in a Response to get a ReadableStream backed by the file via new Response(blob).body). Possibly we should get a less hacky way of doing that, but that would be w3c/FileAPI#40 anyway.

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

6 participants