export function debounce any>( func: F, timeout: number, ) { let timer: Parameters[0] return (...args: Parameters) => new Promise(rs => { clearTimeout(timer) timer = setTimeout(() => rs(func(...args)), timeout) }) } export const noopFalse = () => false export const noop = () => {}