This PR is a bit messy: adding graphql schema adding create company creation on company select on People page some frontend refactoring to be continued --------- Co-authored-by: Charles Bochet <charles@twenty.com>
13 lines
301 B
TypeScript
13 lines
301 B
TypeScript
export const debounce = <FuncArgs extends any[]>(
|
|
func: (...args: FuncArgs) => void,
|
|
delay: number,
|
|
) => {
|
|
let timeoutId: ReturnType<typeof setTimeout>;
|
|
return (...args: FuncArgs) => {
|
|
clearTimeout(timeoutId);
|
|
timeoutId = setTimeout(() => {
|
|
func(...args);
|
|
}, delay);
|
|
};
|
|
};
|