Code Monkey home page Code Monkey logo

Comments (5)

kubk avatar kubk commented on August 17, 2024

Hi, I’ve copied a part of your code with a nested object, and the issue isn’t reproducible for me.

Screenshot 2023-11-08 at 18 08 06

Code:

Screenshot 2023-11-08 at 18 10 56

May I ask for a simple GitHub reproduction as well as screenshots from the devtools? To avoid setting up everything from scratch, you can fork the repo, go to the example folder and modify the demo project. Use npm i && npm run start to set it up: https://github.com/kubk/mobx-log/tree/master/example

I use this subproject to test the library

from mobx-log.

vaughnkoch avatar vaughnkoch commented on August 17, 2024

Thanks for investigating. I forked the repo, modified stopwatch-store.ts, and was able to repro, although the behavior seems slightly different.

Commit in my fork: vaughnkoch@e13d240

I labeled the scenarios A through D below. I also attached a zipfile with the screenshots.

mobx-log screenshots - Issue 43.zip

const data = {
  // A: Does not work.
  // todos are populated at StopwatchStore@nextStep,
  // expected at setTodos or fetchData.
  'abc': { id: 'abc', firstName: 'First', lastName: 'Last' },

  // B: Does not work.
  // todos are populated at StopwatchStore@start,
  // expected at setTodos or fetchData.
  // 'def': { id: 'def' },

  // C: Works.
  // todos are populated at StopwatchStore@fetchData,
  // although not at setTodos.
  // 'def': 'xyz',

  // D: Works.
  // todos are populated at StopwatchStore@setTodos.
  // Blank object
}

from mobx-log.

kubk avatar kubk commented on August 17, 2024

@vaughnkoch Thanks. Try installing an experimental fix npm i mobx-log@beta. If NPM can't locate that version - clear the cache first via npm cache clean --force

from mobx-log.

vaughnkoch avatar vaughnkoch commented on August 17, 2024

Hi @kubk, I tried mobx-log@beta ([email protected]), and it appears to fix the problem, thanks! When do you think this new fix will be available in non-beta? Also, I'd be curious to know what the fix was.

from mobx-log.

kubk avatar kubk commented on August 17, 2024

@vaughnkoch 2.2.3 is ready. Thanks for reporting the issue.

I had to use setTimeout to delay the creation of the store snapshot. The previous implementation only utilized spyReportStart/spyReportEnd, and it seems like it wasn’t enough: https://mobx.js.org/analyzing-reactivity.html#:~:text=report%2Dend-,spyReportEnd,-%3Dtrue%2C%20time%3F%20(total

from mobx-log.

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.