throttle_debounce 0.1.2 copy "throttle_debounce: ^0.1.2" to clipboard
throttle_debounce: ^0.1.2 copied to clipboard

outdatedDart 1 only

Dart port of jquery-throttle-debounce

example/main.dart

import 'package:throttle_debounce/throttle_debounce.dart';
import 'dart:html' as html;


main() {
  html.Element input1 = html.querySelector('#inputBox1');
  var debouncer = new Debouncer(const Duration(milliseconds:250), callback, ['called'], true); 
  input1.onKeyUp.listen((e) {
    debouncer.debounce();
  });
  html.Element input2 = html.querySelector('#inputBox2');
  var throttler = new Throttler(const Duration(milliseconds:250), callback, ['throttled'], true);
  input2.on['keyup'].listen((e) {
    throttler.throttle();
  });
}

callback(List args) {
  print(args[0]);
}
0
likes
25
pub points
34%
popularity

Publisher

unverified uploader

Dart port of jquery-throttle-debounce

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on throttle_debounce