skip_with_time 0.1.0 skip_with_time: ^0.1.0 copied to clipboard
A stream transformer that skips all events before a specified duration.
Skip With Time #
A stream transformer that skips all events before a specified duration.
Example #
import 'dart:async';
import 'package:skip_with_time/skip_with_time.dart';
main() {
var controller = new StreamController();
var transformer = new SkipWithTime(new Duration(seconds: 5));
var skipped = controller.stream.transform(transformer);
// print the events that we didn't skip
skipped.listen(print);
new Timer.periodic(new Duration(seconds: 1), (_) {
controller.add("Stream all the things!!");
});
}