mirror of
https://github.com/leptos-rs/leptos.git
synced 2026-07-16 15:18:42 -04:00
fix: MaybeProp fn deref implementation
This commit is contained in:
@@ -181,10 +181,40 @@ impl_readable_deref_arena_signal_types![
|
||||
Signal,
|
||||
ArcSignal,
|
||||
ArcMemo,
|
||||
MaybeSignal,
|
||||
MaybeProp
|
||||
MaybeSignal
|
||||
];
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl<
|
||||
T: Clone + 'static,
|
||||
S: Storage<T>
|
||||
+ Storage<Option<T>>
|
||||
+ Storage<SignalTypes<Option<T>, S>>
|
||||
+ 'static,
|
||||
> std::ops::Deref for MaybeProp<T, S>
|
||||
where
|
||||
MaybeProp<T, S>: crate::traits::Get<Value = Option<T>>,
|
||||
{
|
||||
type Target = dyn Fn() -> Option<T>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
unsafe { readable_deref_impl::ReadableDerefImpl::deref_impl(self) }
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(deprecated)]
|
||||
impl<
|
||||
T: Clone + 'static,
|
||||
S: Storage<T>
|
||||
+ Storage<Option<T>>
|
||||
+ Storage<SignalTypes<Option<T>, S>>
|
||||
+ 'static,
|
||||
> readable_deref_impl::ReadableDerefImpl for MaybeProp<T, S>
|
||||
where
|
||||
MaybeProp<T, S>: crate::traits::Get<Value = Option<T>>,
|
||||
{
|
||||
}
|
||||
|
||||
// =============================================================================
|
||||
// Write-side Deref impls: Deref<Target = dyn Fn(T)>
|
||||
// =============================================================================
|
||||
|
||||
Reference in New Issue
Block a user