removeAsset method
Removes an asset from the asset graph
This will remove all references to the asset from the graph including directives, identifiers and outputs
Implementation
@override
void removeAsset(String id) {
assets.remove(id);
// remove all directives that reference this asset
directives.removeWhere((String key, List<List<dynamic>> value) {
value.removeWhere(
(List<dynamic> element) => element[GraphIndex.directiveSrc] == id,
);
return value.isEmpty;
});
directives.remove(id);
// remove all identifiers that reference this asset
identifiers.removeWhere(
(List<dynamic> element) => element[GraphIndex.identifierSrc] == id,
);
// remove all outputs that reference this asset
for (final MapEntry<String, Set<String>> entry in outputs.entries) {
entry.value.remove(id);
}
outputs.remove(id);
}