fix(reactive): avoid chain reactions missing
Before submitting a pull request, please make sure the following is done...
- [✅] Ensure the pull request title and commit message follow the Commit Specific in English.
- [ ✅] Fork the repo and create your branch from
masterorformily_next. - [ ✅] If you've added code that should be tested, add tests!
- [ ] If you've changed APIs, update the documentation.
- [✅ ] Ensure the test suite passes (
npm test). - [ ✅] Make sure your code lints (
npm run lint) - we've done our best to make sure these rules match our internal linting guidelines.
Please do not delete the above content
What have you changed?
可以查看最新的单个 commit 来看当前 pr 更改内容。
避免因链式响应,比如 fn1 收集依赖 A,fn2 收集并更新依赖 A,在 A 改变时,触发 fn1 和 fn2,其中 fn2 再次触发 fn1 时,因为 fn1 的防死循环机制(_boundary) ,导致 fn1 不能被再次触发获取到最新的依赖 A。
链式响应应该确保本身不会被再次执行,同时只需要触发最新的一次响应。 比如是先 fn1 再 fn2 的顺序,应该先执行 fn1 再执行 fn2 再执行 fn1 (一定会执行最新的一次) 如果两个函数调换顺序,则应该只需要执行 fn2 fn1,fn1 只会被执行一次(一定会执行最新的一次)
具体的响应策略和之前的 pr 不太一致,但想要解决的问题是一致的。
#4255
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.