throttle method

dynamic throttle(
  1. Function func
)

Implementation

dynamic throttle(Function func) {
  if (!_isReady) return null;
  _stateSC.sink.add(false);
  _isReady = false;
  _waiter
    ..then((_) {
      _isReady = true;
      _stateSC.sink.add(true);
    });
  return Function.apply(func, List.empty());
}