Code Monkey home page Code Monkey logo

Comments (2)

mweststrate avatar mweststrate commented on May 19, 2024

If you could find the cause that would be nice :) Although a defensive copy
here would be wise in any case. A possible cause might be starting a
transaction in a computed expression or autorun. In such a way that
finishing one transaction kicks of another one. if I look at this code I
think that might go wrong. Especially the second solution would fix such a
situation (which should be supported).

On Sat, Dec 5, 2015 at 8:46 PM, Kevin Malakoff [email protected]
wrote:

I think the logic (here)[
https://github.com/mweststrate/mobservable/blob/master/src/dnode.ts#L49]
is to catch some updating changes mid-update.

However, It looks like markReady can alter the changedValues array length
which is causing the 'cannot read property 'markReady' of undefined' error.

Should the solution be:

       var length_1 = changedValues.length;
        for (var i = 0; i < length_1; i++)
            !changedValues[i] || changedValues[i].markReady(true);
        changedValues.splice(0, length_1);
        if (changedValues.length)
            throw new Error("[mobservable] Illegal State, please file a bug report");

or

       var values = changedValues.splice(0);
        for (var i = 0; i < length_1; i++)
            values[i].markReady(true);
        if (changedValues.length)
            throw new Error("[mobservable] Illegal State, please file a bug report");

or do you need me to try to figure out why the issue is happening in the
first place? (I've got a transaction that does quite a variety of actions
so perhaps values could be changed mid update).


Reply to this email directly or view it on GitHub
#65.

from mobx.

kmalakoff avatar kmalakoff commented on May 19, 2024

Stepped through a test case. It was like you suspected that a transaction was being triggering during the processing of another transaction.

Basically, in the short term (until your cool "Reactive graph transformations" come through!), I was batching up a bunch of changes and periodically running them in a transaction which then triggered the rendering transaction mid-processing.

from mobx.

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.