Skip to main content

at_turn_end

Function at_turn_end 

Source
pub fn at_turn_end(cb: impl FnOnce() + 'static)
Expand description

Run cb once, when the current turn settles: after the drain inside a drain or a batch (even a batch that leaves no reactive work behind), or right away when no turn is open.

This is how a consumer coalesces a burst of changes into one pass. Swapping a page withdraws the old page’s toolbar items and contributes the new page’s within one turn, and only the settled result is worth handing to the toolkit.