Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: packages/quiver/lib/src/async/countdown_timer.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/quiver/lib/src/async/concat.dart ('k') | packages/quiver/lib/src/async/enumerate.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/quiver/lib/src/async/countdown_timer.dart
diff --git a/packages/quiver/lib/src/async/countdown_timer.dart b/packages/quiver/lib/src/async/countdown_timer.dart
index cd052e7766be9afd22ac7ecd5bc95a0ad17f62df..6e17c84432e70be850a8163e7aee055b67ab3963 100644
--- a/packages/quiver/lib/src/async/countdown_timer.dart
+++ b/packages/quiver/lib/src/async/countdown_timer.dart
@@ -14,36 +14,35 @@
part of quiver.async;
-/**
- * A simple countdown timer that fires events in regular increments until a
- * duration has passed.
- *
- * CountdownTimer implements [Stream] and sends itself as the event. From the
- * timer you can get the [remaining] and [elapsed] time, or [cancel] the timer.
- */
+/// A simple countdown timer that fires events in regular increments until a
+/// duration has passed.
+///
+/// CountdownTimer implements [Stream] and sends itself as the event. From the
+/// timer you can get the [remaining] and [elapsed] time, or [cancel] the
+/// timer.
class CountdownTimer extends Stream<CountdownTimer> {
static const _THRESHOLD_MS = 4;
final Duration _duration;
- final Duration _increment;
final Stopwatch _stopwatch;
+
+ /// The duration between timer events.
+ final Duration increment;
final StreamController<CountdownTimer> _controller;
Timer _timer;
- /**
- * Creates a new [CountdownTimer] that fires events in increments of
- * [increment], until the [duration] has passed.
- *
- * [stopwatch] is for testing purposes. If you're using CountdownTimer and
- * need to control time in a test, pass a mock or a fake. See [FakeAsync] and
- * [FakeStopwatch].
- */
+ /// Creates a new [CountdownTimer] that fires events in increments of
+ /// [increment], until the [duration] has passed.
+ ///
+ /// [stopwatch] is for testing purposes. If you're using CountdownTimer and
+ /// need to control time in a test, pass a mock or a fake. See [FakeAsync]
+ /// and [FakeStopwatch].
CountdownTimer(Duration duration, Duration increment, {Stopwatch stopwatch})
: _duration = duration,
- _increment = increment,
+ increment = increment,
_stopwatch = stopwatch == null ? new Stopwatch() : stopwatch,
- _controller = new StreamController<CountdownTimer>.broadcast(
- sync: true) {
+ _controller =
+ new StreamController<CountdownTimer>.broadcast(sync: true) {
_timer = new Timer.periodic(increment, _tick);
_stopwatch.start();
}
« no previous file with comments | « packages/quiver/lib/src/async/concat.dart ('k') | packages/quiver/lib/src/async/enumerate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698