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

Unified Diff: pkg/barback/lib/src/phase.dart

Issue 26413003: Make PhaseOutput emit a new AssetNode whenever it changes outputs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review change Created 7 years, 2 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 | « pkg/barback/lib/src/asset_node.dart ('k') | pkg/barback/lib/src/phase_output.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/phase.dart
diff --git a/pkg/barback/lib/src/phase.dart b/pkg/barback/lib/src/phase.dart
index b83061bb96a1a200fd730319aef32d4c70375978..af595e742cecf825bb52e83e4be3b447dec08670 100644
--- a/pkg/barback/lib/src/phase.dart
+++ b/pkg/barback/lib/src/phase.dart
@@ -222,12 +222,6 @@ class Phase {
// [_next], rather than this phase. Any transforms consuming [output] will
// be re-run and will consume the output from the new final phase.
output.removeListeners();
-
- // Removing [output]'s listeners will cause it to be removed from
- // [_outputs], so we have to put it back.
- _outputs[output.output.id] = output;
- output.output.whenRemoved.then((_) => _outputs.remove(output.output.id));
- _next.addInput(output.output);
}
return _next;
}
@@ -305,9 +299,9 @@ class Phase {
_outputs[asset.id].add(asset);
} else {
_outputs[asset.id] = new PhaseOutput(this, asset);
- _outputs[asset.id].output.whenRemoved.then((_) {
- _outputs.remove(asset.id);
- });
+ _outputs[asset.id].onAsset.listen((output) {
+ if (_next != null) _next.addInput(output);
+ }, onDone: () => _outputs.remove(asset.id));
if (_next != null) _next.addInput(_outputs[asset.id].output);
}
}
« no previous file with comments | « pkg/barback/lib/src/asset_node.dart ('k') | pkg/barback/lib/src/phase_output.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698