compose-derive

Crates.iocompose-derive
lib.rscompose-derive
version0.1.0
sourcesrc
created_at2022-03-14 04:39:16.468079
updated_at2022-03-14 04:39:16.468079
descriptionA positional memoization runtime similar to Jetpack Compose Runtime.
homepagehttps://github.com/cksac/compose-rt
repositoryhttps://github.com/cksac/compose-rt
max_upload_size
id549621
size3,843
cksac (cksac)

documentation

README

compose-derive

transform function into compose function

#[compose]
pub fn MoviesScreen(movies: &Vec<Movie>) {
    Column(cx, |cx| {
        for movie in movies {
            cx.tag(movie.id, |cx| MovieOverview(cx, &movie));
        }
    });
}

// after expand
#[track_caller]
pub fn MoviesScreen(cx: &mut compose_rt::Composer, movies: &Vec<Movie>) {
    Column(cx, |cx| {
        for movie in movies {
            cx.tag(movie.id, |cx| MovieOverview(cx, &movie));
        }
    });
}
Commit count: 83

cargo fmt