| 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 a9e000092d74681e52840bee14660d01ff130ac7..629599c06ed7e6112f6aa52b4e8ee56fab10b5ce 100644
|
| --- a/packages/barback/lib/src/asset/asset_node.dart
|
| +++ b/packages/barback/lib/src/asset/asset_node.dart
|
| @@ -59,8 +59,8 @@ class AssetNode {
|
|
|
| /// Whether this node is lazy, meaning that [force] must be called to
|
| /// guarantee that it will eventually become available.
|
| - bool get isLazy => _lazyCallback != null ||
|
| - (_origin != null && _origin.isLazy);
|
| + bool get isLazy =>
|
| + _lazyCallback != null || (_origin != null && _origin.isLazy);
|
|
|
| /// A broadcast stream that emits an event whenever the node changes state.
|
| ///
|
| @@ -83,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/*<T>*/ whenAvailable/*<T>*/(/*=T*/ 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);
|
| @@ -98,7 +98,7 @@ class AssetNode {
|
| ///
|
| /// The return value of [callback] is piped to the returned Future.
|
| Future whenRemoved(callback()) =>
|
| - _waitForState((state) => state.isRemoved, (_) => callback());
|
| + _waitForState((state) => state.isRemoved, (_) => callback());
|
|
|
| /// Returns a [Future] that completes when [state] changes from its current
|
| /// value to any other value.
|
| @@ -114,8 +114,8 @@ 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/*<T>*/ _waitForState/*<T>*/(bool test(AssetState state),
|
| - /*=T*/ callback(AssetState 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));
|
| }
|
| @@ -172,7 +172,7 @@ class AssetNodeController {
|
| ///
|
| /// [callback] is guaranteed to only fire once.
|
| AssetNodeController.lazy(AssetId id, void callback(),
|
| - [TransformNode transform])
|
| + [TransformNode transform])
|
| : node = new AssetNode._lazy(id, transform, null, callback);
|
|
|
| /// Creates a controller for a node whose initial state matches the current
|
|
|