marc2332 / freya

Cross-platform GUI library for 🦀 Rust powered by 🧬 Dioxus and 🎨 Skia.
https://freyaui.dev/
MIT License
1.33k stars 51 forks source link

feat: Simplify return type of `use_animation` #748

Closed marc2332 closed 1 month ago

marc2332 commented 1 month ago

This makes it easier to make custom hooks with use_animation

example:

fn use_custom_animation(origin: &'static str, target: &'static str) -> UseAnimator<ReadAnimatedValue> {
    use_animation(|ctx| {
        ctx.with(
            AnimColor::new(origin, target)
                .time(100)
                .ease(Ease::Out)
        )
    })
}
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 73.75%. Comparing base (03cb4dc) to head (5ee1fc5). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #748 +/- ## ========================================== - Coverage 73.76% 73.75% -0.01% ========================================== Files 198 198 Lines 20352 20349 -3 ========================================== - Hits 15012 15008 -4 - Misses 5340 5341 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.