MyEventDebounceThrottle_c<T> constructor

MyEventDebounceThrottle_c<T>({
  1. required Duration debounceTime,
  2. required Duration time,
  3. required void onListen(
    1. T val
    )?,
  4. required void onDebounceListen(
    1. T
    ),
  5. bool fastFirstRun = true,
})

节流版防抖

  • debounceTime时间内没有新通知notify后,才会触发onListen
  • 并且限制调用notify的频率在time时间内只会触发一次

Implementation

MyEventDebounceThrottle_c({
  required Duration debounceTime,
  required super.time,
  required super.onListen,
  required void Function(T) onDebounceListen,
  super.fastFirstRun = true,
}) {
  debounce = MyEventDebounce_c(
    fastFirstRun: false,
    time: debounceTime,
    onListen: onDebounceListen,
  );
}