feat: make `Transition` `set_pending` use `#[prop(into)]` (#1746)
This commit is contained in:
parent
661a038780
commit
1bd47f34e5
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Reference in New Issue