throttle function

Throttle throttle(
  1. Function func,
  2. Duration wait, {
  3. bool leading = true,
  4. bool trailing = true,
})

TopLevel lambda to create Throttle functions.

Implementation

Throttle throttle(
  Function func,
  Duration wait, {
  bool leading = true,
  bool trailing = true,
}) =>
    Throttle(
      func,
      wait,
      leading: leading,
      trailing: trailing,
    );