Search packages, repositories and app categories

GitHub repositoryPlugFox/throttling

throttling

Throttler and debouncer in dart

throttling project cover
Stars
39
Forks
4
Last push (UTC)
Nov 22, 2023
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

THROTTLING DART LIBRARY

contain "throttling" and "debouncing" classes

Actions Status Coverage Pub License: MIT Effective Dart Star on Github

Using

See a demonstration of use at dartpad.dev

Throttling example
final thr = Throttling<void>(duration: const Duration(milliseconds: 200));
thr.throttle(() {print(' * 1');}); // print ' * 1'
await Future<void>.delayed(const Duration(milliseconds: 100));
thr.throttle(() {print(' * 2');});
await Future<void>.delayed(const Duration(milliseconds: 100));
thr.throttle(() {print(' * 3');}); // print ' * 3'
thr.close();
Debouncing example
final deb = Debouncing<void>(duration: const Duration(milliseconds: 200));
deb.debounce(() {print(' * 1');});
await Future<void>.delayed(const Duration(milliseconds: 100));
deb.debounce(() {print(' * 2');});
await Future<void>.delayed(const Duration(milliseconds: 100));
deb.debounce(() {print(' * 3');});
await Future<void>.delayed(const Duration(milliseconds: 200));
// print ' * 3'
deb.close();
Plague Fox GitHub avatar
GitHub author

Plague Fox ↗

Talks about @dart-lang and @flutter

Not in Education, Employment, or TrainingMoon
LanguagesDartMakefile

Categories

Packages published by this repository

Dependencies used

Dependency list 2 items

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗