Skip to main content

launch

Function launch 

Source
pub fn launch(content: fn())
Expand description

Runs a composable as the application, with every launch choice left to its default.

ⓘ
#[composable]
fn counter() {
    let count = remember(|| mutable_state_of(0));
    let more = count.clone();
    Button(format!("{}", count.get())).on_click(move || more.update(|count| *count += 1));
}

fn main() {
    compose_rust::launch(counter);
}