Expand docs for isCompleted (#104)
Closes #102
This field is confusing because it documents whether the backing
completer has had `complete` called which doesn't necessarily correspond
to when the value is available if it was completed with a `Future`.
diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart
index cbbb8d0..9fd0534 100644
--- a/lib/src/cancelable_operation.dart
+++ b/lib/src/cancelable_operation.dart
@@ -29,6 +29,11 @@
///
/// [onCancel] will be called synchronously when the operation is canceled.
/// It's guaranteed to only be called once.
+ ///
+ /// Calling this constructor is equivalent to creating a [CancelableCompleter]
+ /// and completing it with [inner]. As such, [isCompleted] is true from the
+ /// moment this [CancelableOperation] is created, regardless of whether
+ /// [inner] has completed yet or not.
factory CancelableOperation.fromFuture(Future<T> inner,
{FutureOr Function() onCancel}) {
var completer = CancelableCompleter<T>(onCancel: onCancel);
@@ -125,7 +130,12 @@
/// Whether this operation has been canceled before it completed.
bool get isCanceled => _completer.isCanceled;
- /// Whether this operation completed before being canceled.
+ /// Whether the [CancelableCompleter] backing this operation has been
+ /// completed.
+ ///
+ /// This value being true does not imply that the [value] future has
+ /// completed, but merely that it is no longer possible to [cancel] the
+ /// operation.
bool get isCompleted => _completer.isCompleted;
}