Skip to main content

flush_now

Function flush_now 

Source
pub fn flush_now()
Expand description

Force a synchronous fixpoint drain now, even inside an open batch. Event dispatch wraps handlers in a batch (day-core), so a handler that needs its writes to drain immediately — namely with_animation, whose ambient animation must be live while the resulting patches apply — cannot rely on the batch’s own close (that runs later, after the scope ends). This temporarily drops the batch depth so flush_sync runs, then restores it. No-op if a drain is already in progress (the writes fold into it); harmless if nothing is pending.

Day API ↩ Guides· daybrite.dev