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

[Bug Report] 嵌套的autorun没有执行 #4212

Open
1 task done
xn330125 opened this issue Sep 5, 2024 · 0 comments
Open
1 task done

[Bug Report] 嵌套的autorun没有执行 #4212

xn330125 opened this issue Sep 5, 2024 · 0 comments

Comments

@xn330125
Copy link

xn330125 commented Sep 5, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://codesandbox.io/p/sandbox/sad-babbage-h7rks3?file=%2Findex.tsx

Steps to reproduce

在下面的代码中,改变了obj.b的值后,第一个autorun没有执行,在mobx中一样的代码是没有问题的


const obj = observable({
  a: 1,
  b: 1,
});

autorun(() => {
  console.log("111 a: ", obj.a);
  console.log("111 b: ", obj.b);
});

autorun(() => {
  if (obj.a === 2) {
    console.log("111 change b");
    obj.b = 2;
  }
});

console.log("111 change a");
obj.a = 2;

What is expected?

autorun重新执行

Package

@formily/[email protected]


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

No branches or pull requests

1 participant