From 3aa41b985272b65e9aca174b81ec54d14b1f93b7 Mon Sep 17 00:00:00 2001 From: Matt Hunzinger Date: Fri, 17 Nov 2023 15:38:15 -0500 Subject: [PATCH] Refactor examples --- Cargo.toml | 2 +- examples/{app.rs => counter.rs} | 0 examples/hello.rs | 10 ++++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) rename examples/{app.rs => counter.rs} (100%) create mode 100644 examples/hello.rs diff --git a/Cargo.toml b/Cargo.toml index b10c56a..1ae11aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,5 +46,5 @@ features = ["full"] rustdoc-args = ["--cfg", "docsrs"] [[example]] -name = "app" +name = "counter" required-features = ["full"] diff --git a/examples/app.rs b/examples/counter.rs similarity index 100% rename from examples/app.rs rename to examples/counter.rs diff --git a/examples/hello.rs b/examples/hello.rs new file mode 100644 index 0000000..4e4e9cd --- /dev/null +++ b/examples/hello.rs @@ -0,0 +1,10 @@ +use viewbuilder::prelude::*; + +fn app(cx: Scope) -> Element { + cx.render(rsx! { text { font_size: 100., "Hello World!" } }) +} + +#[tokio::main] +async fn main() { + viewbuilder::launch(app) +}