Giter VIP home page Giter VIP logo

Comments (6)

vbuch avatar vbuch commented on May 28, 2024 2

@didierfranc @runemadsen @bravomartin ^ here is a PR

from react-waterfall.

mstronge avatar mstronge commented on May 28, 2024

@runemadsen Could you utilise the shouldComponentUpdate lifecycle method to solve your issue?

from react-waterfall.

runemadsen avatar runemadsen commented on May 28, 2024

Yes, we are currently using shouldComponentUpdate as a workaround. However:

  1. We have hundreds of connected components that have to do deep equality checks every 100ms. This is a significant performance hit that could be entirely eliminated with a single if() statement in react-waterfall that does not break the current API.

  2. I would argue that the current functionality is undesirable. In a component, I can easily fetch new data and only call setState if the data is different. This is currently impossible in react-waterfall, as setState will be called on every action call, even ones that return nothing. This patterns prevents us from really embracing the store philosophy because we have no ability to perform heavy data fetching without also introducing heavy component logic. PureComponent is no help since connect() creates a new object every time it is called, so the shallow equality check does not work.

I will happily send a PR if it's wanted.

from react-waterfall.

bravomartin avatar bravomartin commented on May 28, 2024

any interest on this?
It would solve my problem too :)

from react-waterfall.

didierfranc avatar didierfranc commented on May 28, 2024

@runemadsen A PR will be great and will solve a real issue ;)

from react-waterfall.

bravomartin avatar bravomartin commented on May 28, 2024

Excellent! That's exactly what I need.

Also very clean implementation 👍

@didierfranc please take a look and merge away 💯

from react-waterfall.

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.