throttle1<T> method
Implementation
void Function(T t) throttle1<T>({int milliseconds = 500}) {
var isAllowed = true;
Timer? throttleTimer;
return (t) {
if (!isAllowed) return;
isAllowed = false;
this(t);
throttleTimer?.cancel();
throttleTimer = Timer(Duration(milliseconds: milliseconds), () {
isAllowed = true;
});
};
}