Skip to main content

loop_while

Function loop_while 

Source
pub async fn loop_while<F: Animation>(
    keep_going: impl FnMut() -> bool,
    make: impl FnMut() -> F,
)
Expand description

Runs the animation make() returns again and again while keep_going() is true (checked before each run). Usually spawned for a background loop: spawn(loop_while(|| true, || pulse.scale().to(1.1, 0.5))).