throttle static method
Implementation
static throttle(
Function func, [
Duration delay = const Duration(milliseconds: 2000),
]) {
String key = func.toString() + '_throttle';
if (enableMap.containsKey(key)) {
return;
} else {
enableMap.addAll({key: true});
func.call();
Timer(delay, () {
enableMap.remove(key);
});
}
}