| Index: pkg/barback/lib/src/transform_node.dart
|
| diff --git a/pkg/barback/lib/src/transform_node.dart b/pkg/barback/lib/src/transform_node.dart
|
| index 863bac53e4991b346b06a3d982c5ed72b99ecf61..9d8bda1ff4a1eda07104162ad3275dcf1c3b5081 100644
|
| --- a/pkg/barback/lib/src/transform_node.dart
|
| +++ b/pkg/barback/lib/src/transform_node.dart
|
| @@ -45,6 +45,15 @@ class TransformNode {
|
| /// The controllers for the asset nodes emitted by this node.
|
| var _outputControllers = new Map<AssetId, AssetNodeController>();
|
|
|
| + /// A stream that emits an event whenever this transform becomes dirty and
|
| + /// needs to be re-run.
|
| + ///
|
| + /// This may emit events when the transform was already dirty or while
|
| + /// processing transforms. Events are emitted synchronously to ensure that the
|
| + /// dirty state is thoroughly propagated as soon as any assets are changed.
|
| + Stream get onDirty => _onDirtyController.stream;
|
| + final _onDirtyController = new StreamController.broadcast(sync: true);
|
| +
|
| TransformNode(this.phase, this.transformer, this.primary) {
|
| _primarySubscription = primary.onStateChange.listen((state) {
|
| if (state.isRemoved) {
|
| @@ -63,6 +72,7 @@ class TransformNode {
|
| /// valid even if its primary input still exists.
|
| void remove() {
|
| _isDirty = true;
|
| + _onDirtyController.close();
|
| _primarySubscription.cancel();
|
| for (var subscription in _inputSubscriptions.values) {
|
| subscription.cancel();
|
| @@ -80,6 +90,7 @@ class TransformNode {
|
| for (var controller in _outputControllers.values) {
|
| controller.setDirty();
|
| }
|
| + _onDirtyController.add(null);
|
| }
|
|
|
| /// Applies this transform.
|
|
|