mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
b3cff22db3
* fixing some types * more type fixes * few more * last couple * tiny tweak
14 lines
311 B
TypeScript
14 lines
311 B
TypeScript
import { debounce, memoize } from 'lodash';
|
|
|
|
export default <T>(func: (...args: T[]) => void, wait = 7000) => {
|
|
const mem = memoize(
|
|
(...args) =>
|
|
debounce(func, wait, {
|
|
leading: true,
|
|
}),
|
|
(...args) => JSON.stringify(args)
|
|
);
|
|
|
|
return (...args: T[]) => mem(...args)(...args);
|
|
};
|