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

Dart 1 only

A stream transformer for slowing down (buffering) events that may happen frequently

Throttle #

A stream transformer for slowing down (buffering) events that may happen frequently

Example #

import 'dart:async';
import 'package:throttle/throttle.dart';

main() {
  var controller  = new StreamController();
  var transformer = new Throttle(new Duration(seconds: 1));
  var throttled   = controller.stream.transform(transformer);

  // print the throttled events as they arrive
  throttled.listen(print);

  // print some events as fast as possible
  for (var i = 0; i < 10; i++) {
    controller.add(i);
  }
}
0
likes
25
pub points
0%
popularity

Publisher

unverified uploader

A stream transformer for slowing down (buffering) events that may happen frequently

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on throttle