Giter VIP home page Giter VIP logo

Comments (5)

rynkowsg avatar rynkowsg commented on August 16, 2024

Another observation: aren't debounce and sched/schedule-animation! overlapping functionality. At the first glance sched/schedule-animation! looks like throttle-first with a global state.

(debounce (throttle-first (fn [] ...) 16) 16)

Since the debounce encapsules sched/schedule-animation!, the latter is not going to do anything, unless sched/schedule-animation! with that particular action is also used somewhere else.

from fulcro.

awkay avatar awkay commented on August 16, 2024

Your problem report is not clear to me. Are you observing a condition where the UI is incorrect? Or are you reporting that you don't like it that render might be called more than you like?

from fulcro.

rynkowsg avatar rynkowsg commented on August 16, 2024

This issue is not about double rendering (which was initial reason for my investigation) but about shared props not being recalculated under certain conditions.

Please have a look at issue desc under section titled Problem with schedule-render!. I haven't try to reproduce it, but by reading the code, it looks that calling (schedule-render! app {:force-root? true}) is not guaranteed to honor :force-root? true, meaning when we request force shared props to be recalculated via schedule-render!, under certain conditions they might not get recalculated.

It is not my problem, but if I'm correct, it is a source of occasional issues related to shared props.

I don't have certainty that this is a problem, that is why I opened the issue to report it and listen what you say.

from fulcro.

rynkowsg avatar rynkowsg commented on August 16, 2024

In other words:

  • (render! app {:force-root? true}) - recalculates shared props always
  • (schedule-render! app {:force-root? true}) - most times recalculates shared props, sometimes not

from fulcro.

awkay avatar awkay commented on August 16, 2024

Thanks for the clarification. Your final message was much more consumer-friendly. Succinct and to the point is best.

I agree with your assessment. Schedule render will not accumulate options which will cause a forced-root to be missed. That said, a force root render really should only be used in two cases I can think of: ops like i18n change locale where props have not changed but re-render is necessary, and dev-time.

the i18n code should therefore do a manual render and not a scheduled one.

from fulcro.

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.