Skip to main content

commit_external_properties

Function commit_external_properties 

Source
pub fn commit_external_properties(store: ResMut<'_, PropertyStore>)
Expand description

Second, in-Systems-stage drain of the external typed-property bus, for same-tick commit of main-thread script writes.

drain_external_properties is registered in crate::tick::TickStage::CommandDrain, which is chained before crate::tick::TickStage::Systems. A main-thread script that writes a signal during event dispatch (on_click -> signals.count.set(..)) pushes onto the bus from inside a Systems-stage system, i.e. too late for that tick’s CommandDrain drain - so without this the new value would sit in the bus until the next tick, adding a whole frame of input latency before a bind="text:count" reader reflects it.

The embedder registers this in TickStage::Systems, ordered after the script dispatch systems and before the reactive binding readers (crate::signals::apply_text_bindings et al.), so those writes land in PropertyStore on the very tick the click fired. Cross-thread writers keep using the same bus untouched; entries that happen to be queued here are simply committed a little earlier than CommandDrain would - strictly lower latency, never a correctness change. Distinct system type from drain_external_properties so registering both in the same schedule stays unambiguous.