2
I have error in the function below:
export const throttle = (func: Function, limit: number) => {
let inThrottle: boolean;
return function () {
const args = arguments;
const context = this;
if (!inThrottle) {
func.apply(context, args);
inThrottle = true;
setTimeout(() => inThrottle = false, limit);
}
}
}
I can’t get past the this
to the const
context
appears the following error:
[ts] 'this' implicitly has type 'any' because it does not have a type Annotation.
We did not write [SOLVED] in the title, as you yourself arrived at the solution, you will have to mark your answer as the right answer. You may have to wait 48 hours to release this option for you
– Barbetta
I tried to do this but without success. The following message appears: You cannot vote for your post
– Marquin Ferreira