mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
feat: directly implement IntoView
on resources on stable
This commit is contained in:
parent
f0c1061161
commit
871d2c1b9f
1 changed files with 16 additions and 1 deletions
|
@ -45,7 +45,8 @@ use html::{AnyElement, ElementDescriptor};
|
|||
pub use hydration::{HydrationCtx, HydrationKey};
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
use leptos_reactive::{
|
||||
MaybeProp, MaybeSignal, Memo, ReadSignal, RwSignal, Signal, SignalGet,
|
||||
MaybeProp, MaybeSignal, Memo, ReadSignal, Resource, RwSignal, Signal,
|
||||
SignalGet,
|
||||
};
|
||||
use leptos_reactive::{Oco, TextProp};
|
||||
pub use macro_helpers::*;
|
||||
|
@ -207,6 +208,20 @@ where
|
|||
}
|
||||
}
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
impl<S, T> IntoView for Resource<S, T>
|
||||
where
|
||||
S: Clone,
|
||||
T: IntoView + Clone,
|
||||
{
|
||||
#[cfg_attr(
|
||||
any(debug_assertions, feature = "ssr"),
|
||||
instrument(level = "trace", name = "Signal<T>", skip_all)
|
||||
)]
|
||||
fn into_view(self) -> View {
|
||||
DynChild::new(move || self.get()).into_view()
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
impl<T> IntoView for MaybeSignal<T>
|
||||
where
|
||||
T: IntoView + Clone,
|
||||
|
|
Loading…
Reference in a new issue