use crate::error_template::{AppError, ErrorTemplate};
use leptos::*;
use leptos_meta::*;
use leptos_router::*;
#[component]
pub fn App() -> impl IntoView {
// Provides context that manages stylesheets, titles, meta tags, etc.
provide_meta_context();
view! {
// injects a stylesheet into the document
// id=leptos means cargo-leptos will hot-reload this stylesheet
// sets the document title
// content for this welcome page
}
.into_view()
}>
}
}
#[server]
pub async fn get_all() -> Result, ServerFnError> {
use std::time::Duration;
std::thread::sleep(Duration::from_millis(250));
println!("Loading");
Ok(vec!["data1".to_string(), "data2".to_string()])
}
/// Renders the home page of your application.
#[component]
fn HomePage() -> impl IntoView {
// Creates a reactive value to update the button
let load = create_local_resource(|| (), |_| async move { get_all().await });
view! {