reactive_graph_dynamic_graph_impl/extension/
divergent.rs1use serde_json::json;
2
3use reactive_graph_graph::ComponentTypeId;
4use reactive_graph_graph::ExtensionContainer;
5use reactive_graph_runtime_model::EXTENSION_DIVERGENT;
6
7pub fn is_divergent(extension_container: &impl ExtensionContainer, component_ty: &ComponentTypeId) -> bool {
8 match extension_container.get_own_extension(&EXTENSION_DIVERGENT.clone()) {
9 Some(divergent) => {
10 let component_ty_s = json!(component_ty.to_string());
11 divergent.extension.as_array().map(|d| d.contains(&component_ty_s)).unwrap_or(false)
12 }
13 None => false,
14 }
15}