Giter Site home page Giter Site logo

Comments (5)

masad-frost avatar masad-frost commented on August 15, 2024 3

+1, main problem is 304

from redux-api-middleware.

barrystaes avatar barrystaes commented on August 15, 2024

How could we handle such a redirect.. can fetch() handle this?

If this can be improved in a PR, i'd like to merge in the upcoming 2.0 release.

from redux-api-middleware.

nason avatar nason commented on August 15, 2024

I believe this comes from the use of res.ok here:

if (res.ok) {
return next(await actionWith(successType, [action, getState(), res]));
} else {
return next(
await actionWith(
{
...failureType,
error: true
},
[action, getState(), res]
)
);
}

If we make this configurable, this middleware should be able to support use cases like this one.

from redux-api-middleware.

nason avatar nason commented on August 15, 2024

This is being looked at in #171

from redux-api-middleware.

nason avatar nason commented on August 15, 2024

In 2.x, you can now pass a custom fetch implementation
In 3.x (upcoming), you'll be able to pass a custom ok check

I think this should be enough to handle most situations, so I'm going to close this out. Feel free to re-open or continue commenting here though.

from redux-api-middleware.

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.