We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
当前版本在输入内容时会有些卡顿,因此建议使用防抖函数以减少触发次数。
关于防抖函数的实现,new Bing 这样说:
// 基于时间戳的实现 function debounce(fn, delay) { let timeout = null; return function () { let context = this; let args = arguments; let now = +new Date(); if (timeout && now < timeout) { clearTimeout(timeout); } timeout = setTimeout(function () { fn.apply(context, args); }, delay); }; } // 基于定时器的实现 function debounce(fn, delay) { let timeout = null; return function () { let context = this; let args = arguments; if (timeout) { clearTimeout(timeout); } timeout = setTimeout(function () { fn.apply(context, args); }, delay); }; }
The text was updated successfully, but these errors were encountered:
使用防抖无法解决搜索的问题。目前部分环境下单独输入一个字符也足以上浏览器卡死。
duplicate of #55
Sorry, something went wrong.
使用防抖无法解决搜索的问题。目前部分环境下单独输入一个字符也足以上浏览器卡死。 duplicate of #55
不过应该可以解决输入不跟手的问题(输入的字符串的显示存在延迟)。
有点道理。
8bffbf3
feat(market): support debounced input, fix koishijs#130
d89d743
No branches or pull requests
当前版本在输入内容时会有些卡顿,因此建议使用防抖函数以减少触发次数。
关于防抖函数的实现,new Bing 这样说:
The text was updated successfully, but these errors were encountered: