Git Product home page Git Product logo

Comments (6)

domenic avatar domenic commented on July 21, 2024 3

Not speaking for the editors here, but for my part, I consider FileReader deprecated and replaced by the .stream(), .text(), and .arrayBuffer() methods.

from fileapi.

mkruisselbrink avatar mkruisselbrink commented on July 21, 2024 2

Adding an AbortController to .text() and .arrayBuffer() seems reasonable to me. Agreed that I'd consider FileReader deprecated/legacy, especially now all major browsers support the new methods.

I agree that adding it to Request/Response (i.e. Body) as well would be ideal, but I don't think it would be too bad to only have it here either. It would still be true that you can do anything with these methods on Blob that you can do on other Bodys. And the reverse isn't true already.

from fileapi.

domenic avatar domenic commented on July 21, 2024 1

Yeah, that would make sense to me. Indeed they cannot be aborted currently; you'd need to use .stream() + TextDecoderStream.

from fileapi.

annevk avatar annevk commented on July 21, 2024 1

It would be a bit unfortunate to lose the symmetry with Request/Response, but maybe that's okay. I guess these are already different in that you can invoke them multiple times.

from fileapi.

domenic avatar domenic commented on July 21, 2024 1

I mean, we could also add it to Request / Response's methods. Aborting in that case would probably throw away the entire body.

from fileapi.

benjamingr avatar benjamingr commented on July 21, 2024

@domenic Ah thanks, so in that case the ask should be to support signals in .text and .arrayBuffer?

Is it currently possible to abort an ongoing .text()?

Since it returns a promise and does not take a signal parameter I don't see/know how to do that.

from fileapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.