Component params

This commit is contained in:
2026-01-30 19:02:26 +01:00
parent 2799faaa73
commit 1f64b4f6e2
7 changed files with 75 additions and 53 deletions
+9 -5
View File
@@ -4,7 +4,7 @@ use osui::prelude::*;
pub fn main() {
let engine = Benchmark::new(Console::new());
let benchmark_result = engine.run(app).expect("Failed to run engine");
let benchmark_result = engine.run(App).expect("Failed to run engine");
println!("Avg: {} μs", benchmark_result.average);
println!("Min: {} μs", benchmark_result.min);
println!("Max: {} μs", benchmark_result.max);
@@ -12,9 +12,13 @@ pub fn main() {
println!("Tot Render: {} μs", benchmark_result.total_render);
}
fn app(cx: &Arc<Context>) -> View {
rsx! {
"Hello, world!"
struct App;
impl ComponentImpl for App {
fn call(&self, cx: &Arc<Context>) -> View {
rsx! {
"Hello, world!"
}
.view(cx.clone())
}
.view(cx.clone())
}