mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
Clear warnings in router
example
This commit is contained in:
parent
557bd25e2c
commit
c63c8728a7
3 changed files with 6 additions and 8 deletions
|
@ -92,11 +92,11 @@ pub fn Comment(cx: Scope, comment: api::Comment) -> impl IntoView {
|
|||
let comments = comment.comments.clone();
|
||||
move || view! { cx,
|
||||
<ul class="comment-children">
|
||||
<For
|
||||
/* <For
|
||||
each=move || comments.clone()
|
||||
key=|comment| comment.id
|
||||
view=move |comment: api::Comment| view! { cx, <Comment comment /> }
|
||||
/>
|
||||
/> */
|
||||
</ul>
|
||||
}
|
||||
})}
|
||||
|
|
|
@ -27,9 +27,9 @@ pub struct Contact {
|
|||
pub phone: String,
|
||||
}
|
||||
|
||||
pub async fn get_contacts(search: String) -> Vec<ContactSummary> {
|
||||
pub async fn get_contacts(_search: String) -> Vec<ContactSummary> {
|
||||
// fake an API call with an artificial delay
|
||||
delay(Duration::from_millis(300)).await;
|
||||
_ = delay(Duration::from_millis(300)).await;
|
||||
vec![
|
||||
ContactSummary {
|
||||
id: 0,
|
||||
|
@ -51,7 +51,7 @@ pub async fn get_contacts(search: String) -> Vec<ContactSummary> {
|
|||
|
||||
pub async fn get_contact(id: Option<usize>) -> Option<Contact> {
|
||||
// fake an API call with an artificial delay
|
||||
delay(Duration::from_millis(500)).await;
|
||||
_ = delay(Duration::from_millis(500)).await;
|
||||
match id {
|
||||
Some(0) => Some(Contact {
|
||||
id: 0,
|
||||
|
@ -97,7 +97,7 @@ fn delay(duration: Duration) -> impl Future<Output = Result<(), Canceled>> {
|
|||
let (tx, rx) = oneshot::channel();
|
||||
set_timeout(
|
||||
move || {
|
||||
tx.send(());
|
||||
_ = tx.send(());
|
||||
},
|
||||
duration,
|
||||
);
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
mod api;
|
||||
|
||||
use api::{Contact, ContactSummary};
|
||||
use leptos::*;
|
||||
use leptos_meta::*;
|
||||
use leptos_router::*;
|
||||
|
||||
use crate::api::{get_contact, get_contacts};
|
||||
|
|
Loading…
Reference in a new issue