#memoization #computation #tree #cache

macro compose-derive

A positional memoization runtime similar to Jetpack Compose Runtime

1 unstable release

0.1.0 Mar 14, 2022

#23 in #caching


Used in compose-rt

MIT/Apache

4KB

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));
        }
    });
}

Dependencies

~2MB
~42K SLoC