Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abnormal behavior when access computed value and modify it at same reaction #916

Closed
feibyte opened this issue Mar 30, 2017 · 2 comments
Closed
Assignees
Labels

Comments

@feibyte
Copy link

feibyte commented Mar 30, 2017

I have a Question:
Chrome 56, Mobx version 3.1.7

const store = observable({
  a: 3,
  b: 4,
  get sum() {
    return this.a + this.b;
  },
});
autorun(() => {
  console.log('sum is', store.sum);
  store.b = 5;
});
store.a = 6;

The above code print the result only once.

I doubt that there is a bug.

@andykog andykog self-assigned this Mar 31, 2017
@andykog
Copy link
Member

andykog commented Mar 31, 2017

@fedeoo, nice catch! Working on it.

@mweststrate
Copy link
Member

Released fix as 3.1.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants