mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41:20 -08:00
优化代码
This commit is contained in:
1 parent
d058fc318c
commit
e0a2a2c594
25 files changed
+288
-172
No files matched your search
+7
-1
@@ -120,7 +120,7 @@ export function sublings(target) {
|
||||
|
||||
export function debounce(func, wait, context) {
|
||||
let timeout;
|
||||
return function fn() {
|
||||
function fn() {
|
||||
const args = arguments;
|
||||
const later = function later() {
|
||||
timeout = null;
|
||||
@@ -128,5 +128,11 @@ export function debounce(func, wait, context) {
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
}
|
||||
|
||||
fn.clearTimeout = function ct() {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
|
||||
return fn;
|
||||
}
|
||||
Reference in new issue
Block a user