debouncer_throttler 0.1.0 copy "debouncer_throttler: ^0.1.0" to clipboard
debouncer_throttler: ^0.1.0 copied to clipboard

A simple package that provides debouncing and throttling functionalities.

example/main.dart

// ignore_for_file: avoid_print

import 'package:debouncer_throttler/debouncer_throttler.dart';

Future<void> main() async {
  final debouncer = Debouncer(duration: const Duration(milliseconds: 100));
  final throttler = Throttler(duration: const Duration(milliseconds: 100));

  debouncer.run(() {
    print('debounced call not executed');
  });

  debouncer.run(() {
    print('second debounced call executed');
  });

  throttler.run(() {
    print('throttled call executed');
  });

  throttler.run(() {
    print('second throttled call not executed');
  });

  await Future.delayed(const Duration(milliseconds: 150));
}
1
likes
160
points
16
downloads

Publisher

verified publishernorbertcsorgo.me

Weekly Downloads

A simple package that provides debouncing and throttling functionalities.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on debouncer_throttler