Compare commits

...

3 Commits

Author SHA1 Message Date
Greg Johnston
d4cda02a3f more fix 2023-09-18 20:29:38 -04:00
Greg Johnston
1c413a4098 fix examples 2023-09-18 20:28:54 -04:00
Greg Johnston
9f7c9da1a2 feat: make Transition set_pending use #[prop(into)] 2023-09-17 20:34:58 -04:00
4 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ pub fn Stories() -> impl IntoView {
<div>
<Transition
fallback=move || view! { <p>"Loading..."</p> }
set_pending=set_pending.into()
set_pending
>
{move || match stories.get() {
None => None,

View File

@@ -70,7 +70,7 @@ pub fn Stories() -> impl IntoView {
>
<a href=move || format!("/{}?page={}", story_type(), page() + 1)
aria-label="Next Page"
>
>=
"more >"
</a>
</span>
@@ -79,7 +79,7 @@ pub fn Stories() -> impl IntoView {
<div>
<Transition
fallback=move || view! { <p>"Loading..."</p> }
set_pending=set_pending.into()
set_pending
>
{move || match stories.get() {
None => None,

View File

@@ -91,7 +91,7 @@ pub fn Stories() -> impl IntoView {
<div>
<Transition
fallback=|| ()
set_pending=set_pending.into()
set_pending
>
{move || stories.get().map(|story| story.map(|stories| view! {
<ul>

View File

@@ -39,7 +39,7 @@ use std::{
/// <div>
/// <Transition
/// fallback=move || view! { <p>"Loading..."</p>}
/// set_pending=set_pending.into()
/// set_pending
/// >
/// {move || {
/// cats.read().map(|data| match data {
@@ -72,7 +72,7 @@ pub fn Transition<F, E>(
/// A function that will be called when the component transitions into or out of
/// the `pending` state, with its argument indicating whether it is pending (`true`)
/// or not pending (`false`).
#[prop(optional)]
#[prop(optional, into)]
set_pending: Option<SignalSetter<bool>>,
/// Will be displayed once all resources have resolved.
children: Box<dyn Fn() -> Fragment>,