Git Product home page Git Product logo

Comments (6)

secobarbital avatar secobarbital commented on June 10, 2024

Thanks, @teohhanhui, I think that makes sense.

The problem in this case is that besides the goal being the same, the interface actually differs from the http driver on the response end: res.text() vs res.body and res.json() vs JSON.stringify(res.body), not to mention flatMap vs map.

Do you think it might be confusing to users if we presented it as a drop-in replacement for the http driver?

from cycle-fetch-driver.

teohhanhui avatar teohhanhui commented on June 10, 2024

It's not a drop-in replacement but an alternative driver serving the same purpose (handling HTTP requests and responses). Some confusion is inevitable for those who don't read but I don't think it should be a serious concern.

Alternatively, we could change the examples of existing HTTP driver to use xhr but do we really need / want the user to be conscious of the implementation?

p/s: The current name Fetch is in the wrong case IMO; how I wish those were named dom and http respectively to avoid such confusion.

from cycle-fetch-driver.

teohhanhui avatar teohhanhui commented on June 10, 2024

I think the difference in interface is not a problem as even a major version of the same driver can change the interface.

from cycle-fetch-driver.

secobarbital avatar secobarbital commented on June 10, 2024

That's a good point. Let me think this through.

Re: the case of the driver keys, I understand where you're coming from, CamelCase convention is for classes, but staltz just picked it to differentiate it from normal observables, for which he used the convention xyz$. User is certainly free to use any valid keys for them.

from cycle-fetch-driver.

teohhanhui avatar teohhanhui commented on June 10, 2024

Re: the case of the driver keys, not really: https://github.com/cyclejs/todomvc-cycle/blob/e5f42b0ecf061d356e89d32b14fd3a9e2a3202b4/src/app.js

I think DOM and HTTP are only uppercase because those are abbreviations, but apparently it has led to confusion.

from cycle-fetch-driver.

secobarbital avatar secobarbital commented on June 10, 2024

Sold! Will update once I get the chance. You are welcome to send a PR if you get to it sooner.

from cycle-fetch-driver.

Related Issues (11)

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.