#[macro_export]
macro_rules! render {
(
in: $arg_surface : expr, // Eg: in: surface
component_id: $arg_component_id : expr, // Eg: "component1"
from: $arg_registry : expr, // Eg: from: registry
state: $arg_state : expr, // Eg: state
shared_store: $arg_shared_store : expr, // Eg: shared_store
shared_tw_data: $arg_shared_tw_data : expr // Eg: shared_tw_data
) => {
let maybe_component_ref =
ComponentRegistry::get_component_ref_by_id(&mut $arg_registry, $arg_component_id);
if let Some(component_ref) = maybe_component_ref {
let current_box = $arg_surface.current_box()?;
let queue = component_ref
.write()
.await
.render(
ComponentScopeArgs {
shared_tw_data: $arg_shared_tw_data,
shared_store: $arg_shared_store,
state: $arg_state,
component_registry: &mut $arg_registry,
},
current_box,
)
.await?;
$arg_surface.render_pipeline += queue;
}
};
}