Chromium Code Reviews| Index: pkg/barback/lib/src/phase_output.dart |
| diff --git a/pkg/barback/lib/src/phase_output.dart b/pkg/barback/lib/src/phase_output.dart |
| index ae309d9820eba63990cd6e77601aabc457d5a267..ccfc15971703204f59e081e0aec99c8fa83336f7 100644 |
| --- a/pkg/barback/lib/src/phase_output.dart |
| +++ b/pkg/barback/lib/src/phase_output.dart |
| @@ -28,7 +28,7 @@ class PhaseOutput { |
| /// The asset node for this output. |
| AssetNode get output => _outputController.node; |
| - final AssetNodeController _outputController; |
| + AssetNodeController _outputController; |
| /// The assets for this output. |
| /// |
| @@ -59,6 +59,16 @@ class PhaseOutput { |
| _watchAsset(node); |
| } |
| + /// Removes all existing listeners on [output] without actually closing |
| + /// [this]. |
| + /// |
| + /// This marks [output] as removed, but immediately replaces it with a new |
| + /// [AssetNode] in the same state as the old output. |
|
Bob Nystrom
2013/08/22 19:34:19
A bit of motivation here would help.
|
| + void removeListeners() { |
| + _outputController.setRemoved(); |
| + _outputController = new AssetNodeController.from(_assets.first); |
| + } |
| + |
| /// Watches [node] for state changes and adjusts [_assets] and [output] |
| /// appropriately when they occur. |
| void _watchAsset(AssetNode node) { |