throttling 2.0.1 copy "throttling: ^2.0.1" to clipboard
throttling: ^2.0.1 copied to clipboard

Contain "throttling" and "debouncing" async helper classes with listeners

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();
40
likes
140
points
10.7k
downloads

Publisher

verified publisherplugfox.dev

Weekly Downloads

Contain "throttling" and "debouncing" async helper classes with listeners

Repository (GitHub)
View/report issues

Topics

#throttling #debouncing #throttle #debounce #async

Documentation

API reference

Funding

Consider supporting this project:

www.buymeacoffee.com
www.patreon.com
boosty.to

License

MIT (license)

More

Packages that depend on throttling