hooks
hooks copied to clipboard
fix: useAsync中的debounceRun和throttleRun设置lodash对应函数返回值的类型
🤔 这个变动的性质是?
- [x] TypeScript 定义更新
💡 需求背景和解决方案
useAsync中引用了lodash.debounce和lodash.throttle没有类型提示。
给debounceRun和throttleRun添加准确的类型提示。
📝 更新日志
语言 | 更新描述 |
---|---|
🇺🇸 英文 | Add exact type hints to debounceRun and throttleRun in useAsync |
🇨🇳 中文 | useAsync中的debounceRun和throttleRun添加准确的类型提示 |
☑️ 请求合并前的自查清单
⚠️ 请自检并全部勾选全部选项。⚠️
- [x] 文档已补充或无须补充
- [x] 代码演示已提供或无须提供
- [x] TypeScript 定义已补充或无须补充
- [x] Changelog 已提供或无须提供
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.
有人看PR吗 。。。
有人看PR吗 。。。
有的,这个暂时不能合并。 现在版本的 debounce 模式的 return 其实是有问题的,正常应该返回 promise。
下个大版本这块彻底重构了:https://github.com/alibaba/hooks/blob/next/packages/hooks/src/useRequest/src/plugins/useDebouncePlugin.ts