Comments (2)
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.
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)
- Flow JS Types not longer exported in package build? (Upgrade MobX 4 -> 6) HOT 1
- observable is not working when placed inside a function HOT 3
- @action @observable not work in @observer Class Component HOT 4
- Uncaught ReferenceError: process is not defined HOT 1
- mobx-react @inject does not work with new decorators HOT 1
- Using makeAutoObservable before variable initialization doesnt trigger state changes HOT 1
- @action field uses addInitializer from decorator context but that does not exist in the (new) spec HOT 2
- TS complains about @override
- `StubArray` workaround is incompatible with terser's `unsafe_arrows` option HOT 4
- mobx-react-lite component wrapped in `observer` renders twice in latest Next.js HOT 3
- Peer dependency issue for [email protected] HOT 4
- Migration from Mobx 4 > 6 HOT 6
- `trackDerivedFunction` pre-allocates memory for new deps array too aggressively HOT 1
- Invalid/extra warning in observable.box(array)
- Recommended pattern `MyComp = observer(function MyComp() {...})` leads to subtle bug
- Storing a Lit template in a mobx store does not work HOT 3
- Cannot update past `6.10.0` HOT 1
- Supporting of new Set methods in observable Sets HOT 3
- [feature] Investigate running MobX on top of signals standard / polyfill HOT 1
- [eslint-plugin-mobx] ESLint v9 Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mobx.