hooks icon indicating copy to clipboard operation
hooks copied to clipboard

fix: useAsync中的debounceRun和throttleRun设置lodash对应函数返回值的类型

Open Drowned-fish opened this issue 3 years ago • 3 comments

🤔 这个变动的性质是?

  • [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 已提供或无须提供

Drowned-fish avatar Oct 18 '21 16:10 Drowned-fish

CLA assistant check
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.

CLAassistant avatar Oct 18 '21 16:10 CLAassistant

有人看PR吗 。。。

Drowned-fish avatar Oct 28 '21 05:10 Drowned-fish

有人看PR吗 。。。

有的,这个暂时不能合并。 现在版本的 debounce 模式的 return 其实是有问题的,正常应该返回 promise。

下个大版本这块彻底重构了:https://github.com/alibaba/hooks/blob/next/packages/hooks/src/useRequest/src/plugins/useDebouncePlugin.ts

brickspert avatar Oct 28 '21 07:10 brickspert