formily
formily copied to clipboard
x-rules 函数返回promise时校验结果显示有延时
Help us to manage our issues by answering the following:
- How would you tag this issue?
- Bug
- Describe your issue:
x-rules 函数如果返回的promise,校验结果会在下次表达状态变更时才显示出来
- If your issue is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via Bug Report Template on CodeSandbox
https://codesandbox.io/s/blissful-galileo-88xre
这个问题,核心还是因为debounce函数没有返回Promise导致的,它不会hold整个执行链,所以参考该例子,使用promise-debounce即可解决问题。https://codesandbox.io/s/nice-dubinsky-vz0pk