Git Product home page Git Product logo

Comments (12)

ryanbrainard avatar ryanbrainard commented on May 14, 2024

@eyalw Can you give an example and version number please?

from react-refetch.

eyalw avatar eyalw commented on May 14, 2024

Yes, I will on Sunday when I get back to my work computer,
but for now it was something like
{
comparison: ...
then: (res) => {
value: res.data,
}
}

and fetches kept being sent even though comparison value didn't change.
then I removed then() and they stopped.

from react-refetch.

eyalw avatar eyalw commented on May 14, 2024

This is the exact code, i commented the lines that caused the bad behavior (refetching without change to url)

(the then() is the issue, the comparison was an attempt to solve the issue, which didnt work eiher)

f6098f9c-d3d7-11e5-930b-ee3492ef3b69

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

Thanks @eyalw, I'll try to look into this week.

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

@eyalw Happen to have anything to do with the missing commas between your key-values?

from react-refetch.

eyalw avatar eyalw commented on May 14, 2024

no.. the code compiled, not a noob :)
I must have removed them after i commented or something...

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

Haven't nailed down exactly what is happening, but I was able to reproduce and there's definitely something weird going on here. Hope to dig in more soon.

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

Oh, I see what it is. The identity request in the then is overwriting the original equality check where the comparison happens. Need to test, but pretty sure that's what's happening.

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

See #64 for a fix

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

Workaround in the meantime: set comparison again inside the object returned by then

from react-refetch.

eyalw avatar eyalw commented on May 14, 2024

Thanks :)

from react-refetch.

ryanbrainard avatar ryanbrainard commented on May 14, 2024

Released in https://github.com/heroku/react-refetch/releases/tag/v0.7.0-beta.3

from react-refetch.

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.