-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat(useThrottleFn/useDebounceFn): support requestAnimationFrame #2332
Conversation
Thank you for your contribution. |
@@ -17,7 +17,8 @@ function useDebounceFn<T extends noop>(fn: T, options?: DebounceOptions) { | |||
|
|||
const fnRef = useLatest(fn); | |||
|
|||
const wait = options?.wait ?? 1000; | |||
// https://github.com/alibaba/hooks/issues/2331 | |||
const wait = 'wait' in options ? options.wait : 1000; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to have "breaking changes", advise to do in v4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
存在 breaking changes 的:
旧行为:
// 设置
{ wait: undefined }
// 被处理成
{ wait: 1000 }
新行为:
// 设置
{ wait: undefined }
// 被处理成
{ wait: undefined }
这个当做 v4 的 feature, @zhe-he 把 pr 往 v4 上合呢。 |
刚看见这条通知,看见基础分支已被更新成v4了,好像不需要我做啥😊 |
fix: #2331