use cranpose_core::NodeId;
use crate::dirty_node_queue::DirtyNodeQueue;
pub fn schedule_semantics_invalidation(node_id: NodeId) {
crate::render_state::with_semantics_dispatch(|queue| queue.schedule(node_id));
}
pub(crate) fn schedule_semantics_invalidation_in(
app_context: crate::render_state::AppContextId,
node_id: NodeId,
) {
crate::render_state::with_semantics_dispatch_by_app_context(app_context, |queue| {
queue.schedule(node_id);
});
}
pub fn has_pending_semantics_invalidations() -> bool {
crate::render_state::require_current_app_context("semantics dispatch access")
.has_pending_semantics_invalidations()
}
pub fn process_semantics_invalidations<F>(processor: F)
where
F: FnMut(NodeId),
{
crate::render_state::with_semantics_dispatch(|queue| queue.process(processor));
}
pub fn clear_semantics_invalidations() {
crate::render_state::with_semantics_dispatch(DirtyNodeQueue::clear);
}