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

Unified Diff: packages/barback/lib/src/asset/asset_node.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/barback/CHANGELOG.md ('k') | packages/barback/lib/src/asset/asset_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/barback/lib/src/asset/asset_node.dart
diff --git a/packages/barback/lib/src/asset/asset_node.dart b/packages/barback/lib/src/asset/asset_node.dart
index 45d1b1771c215f165a2e3c001afb4a7ee5715e00..a9e000092d74681e52840bee14660d01ff130ac7 100644
--- a/packages/barback/lib/src/asset/asset_node.dart
+++ b/packages/barback/lib/src/asset/asset_node.dart
@@ -8,7 +8,6 @@ import 'dart:async';
import '../errors.dart';
import '../graph/transform_node.dart';
-import '../utils.dart';
import 'asset.dart';
import 'asset_id.dart';
@@ -84,7 +83,7 @@ class AssetNode {
/// The return value of [callback] is piped to the returned Future. If the
/// asset is removed before becoming available, the returned future will throw
/// an [AssetNotFoundException].
- Future whenAvailable(callback(Asset asset)) {
+ Future/*<T>*/ whenAvailable/*<T>*/(/*=T*/ callback(Asset asset)) {
return _waitForState((state) => state.isAvailable || state.isRemoved,
(state) {
if (state.isRemoved) throw new AssetNotFoundException(id);
@@ -115,9 +114,9 @@ class AssetNode {
/// [callback] is called synchronously if this is already in such a state.
///
/// The return value of [callback] is piped to the returned Future.
- Future _waitForState(bool test(AssetState state),
- callback(AssetState state)) {
- if (test(state)) return syncFuture(() => callback(state));
+ Future/*<T>*/ _waitForState/*<T>*/(bool test(AssetState state),
+ /*=T*/ callback(AssetState state)) {
+ if (test(state)) return new Future.sync(() => callback(state));
return onStateChange.firstWhere(test).then((_) => callback(state));
}
« no previous file with comments | « packages/barback/CHANGELOG.md ('k') | packages/barback/lib/src/asset/asset_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698