Open toduyemi opened 6 months ago
Rest parameter 'args' implicitly has an 'any[]' type.
Please provide other information which led to this error, and any specific questions you have about it:
I'm really struggling with this error and haven't been able to find anything on how to resolve it. How do you type for rest parameter?
function debouncePromise<T>(fn: (a: T[]) => Promise<T>, time: number) { let timerId: ReturnType<typeof setTimeout> | undefined = undefined; return function debounced(...args) { if (timerId) { clearTimeout(timerId); } return new Promise((resolve) => { timerId = setTimeout(() => resolve(fn(...args)), time); }); }; }
Error Text
Rest parameter 'args' implicitly has an 'any[]' type.
Supporting Information
Please provide other information which led to this error, and any specific questions you have about it:
I'm really struggling with this error and haven't been able to find anything on how to resolve it. How do you type for rest parameter?