From 395714f7e0d1a79b2ac88844f9a94df5e63b2dc6 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar <3998+srid@users.noreply.github.com> Date: Wed, 2 Aug 2023 18:47:01 -0400 Subject: [PATCH] Display nix version (#12) --- src/app.rs | 59 ++++++++++----------------------------------------- src/lib.rs | 2 +- src/main.rs | 2 +- src/nix.rs | 8 +++++++ src/server.rs | 16 +------------- src/thing.rs | 35 ------------------------------ 6 files changed, 22 insertions(+), 100 deletions(-) create mode 100644 src/nix.rs delete mode 100644 src/thing.rs diff --git a/src/app.rs b/src/app.rs index e9dc2784..93d3102d 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,4 +1,4 @@ -use crate::thing::{read_things, ReadThings, Thing}; +use crate::nix; use cfg_if::cfg_if; #[cfg(feature = "ssr")] use http::status::StatusCode; @@ -32,40 +32,20 @@ pub fn App(cx: Scope) -> impl IntoView { #[component] fn Home(cx: Scope) -> impl IntoView { - let thing = Thing::new("Hello from frontend".to_string()); - let things = create_local_resource(cx, move || (), move |_| read_things()); view! { cx,
"This value ⤵️ is generated in-browser:"
-{thing.browser_view()}-
fn_url: {ReadThings::url()}- {move || { - things.read(cx) - .map(move |things| { - log!("things: {:?}", things); - match things { - Err(e) => { - view! { cx,
"Server Error: " {e.to_string()}}.into_view(cx) - } - Ok(things) => { - things.into_iter().map(move |thing| { - view! { - cx, -
++ {format!("{data:?}")} + +