Index: lib/src/cancelable_operation.dart |
diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart |
index 1ba6b3c4759f5b8477fb8740c51ad9c0dfb8cde5..d0a1871f43dab4798ff39a7ad7763c9c5ec2373a 100644 |
--- a/lib/src/cancelable_operation.dart |
+++ b/lib/src/cancelable_operation.dart |
@@ -62,9 +62,9 @@ class CancelableOperation<T> { |
/// If this operation is cancelled, the returned future waits for the future |
/// returned by [cancel], then completes to [cancellationValue]. |
Future valueOrCancellation([T cancellationValue]) { |
- var completer = new Completer.sync(); |
- |
- value.then(completer.complete, onError: completer.completeError); |
+ var completer = new Completer<T>.sync(); |
+ value.then((result) => completer.complete(result), |
+ onError: completer.completeError); |
_completer._cancelMemo.future.then((_) { |
completer.complete(cancellationValue); |