Giter Club home page Giter Club logo

Comments (4)

mweststrate avatar mweststrate commented on June 2, 2024 1

@bengry it depends, if things of the observed by the computed change, the computed has to recompute, if it than concludes it didn't produce a different value than before, it won't propage further, etc.

from mobx-react.

mweststrate avatar mweststrate commented on June 2, 2024

from mobx-react.

MoonBall avatar MoonBall commented on June 2, 2024

@bengry The View component don't re-render although the trace is printed. The log of [mobx.trace] only remind that the reaction maybe run agin(see trace code).The reaction doesn't rerun if it's dependencies are not changed(see shouldCompute).

from mobx-react.

bengry avatar bengry commented on June 2, 2024

In your example someProp isn't read by the computed, but by the component. The struct only works if you create non-observable data structures in your computed.

Now that you mention it, it does make sense. Is it mentioned in the docs that you need to read the individual values? In my real-world scenario I ended up doing a spread on the params, which should work just as well, for any number of properties on the _params object. Please correct me if I'm wrong here though.

@bengry The View component don't re-render although the trace is printed. The log of [mobx.trace] only remind that the reaction maybe run agin.

I stand corrected, I just put a console.count in there and it does indeed not called πŸ‘.
Good to know that a trace() log does not necessarily mean a re-computation. Is that also true for other stuff (i.e. a trace() inside a computed that depends on another observable (or a computed which at the end derives from one..). i.e. the dependant computed won't be re-evaluated even though the trace() placed inside of it is printing?

from mobx-react.

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.