Skip to content

Commit

Permalink
More docs for Timer.cancel()
Browse files Browse the repository at this point in the history
Notably, it's worth documenting that calling `cancel()` twice is safe.

Change-Id: I35fdf3f8a810f78f296fc96750ec9ad4d81c6fc7
Reviewed-on: https://dart-review.googlesource.com/c/83744
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
  • Loading branch information
jonasfj authored and commit-bot@chromium.org committed Nov 21, 2018
1 parent 0fded45 commit 4b51cea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/lib/async/timer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ abstract class Timer {

/**
* Cancels the timer.
*
* Once a [Timer] has been canceled, the callback function will not be called
* by the timer. Calling [cancel] more than once on a [Timer] is allowed, and
* will have no further effect.
*/
void cancel();

Expand Down

0 comments on commit 4b51cea

Please sign in to comment.