Comparing version 0.0.15 to 0.0.16
{ | ||
"name": "webdetta", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"author": "Fedot Kriutchenko <fodyadev@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -15,1 +15,8 @@ const AsyncFunction = (async () => {}).constructor; | ||
safe.errorHandler = e => console.error(e); | ||
export function throttle(f) { | ||
let p; | ||
return (...a) => ( | ||
p ??= Promise.resolve().then(() => p = null).then(() => f(...a)) | ||
); | ||
} |
24453
703