mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
feat: From<ArcRwSignal<_>> for ArcMemo<_>
This commit is contained in:
parent
4fa2e58551
commit
7ed4d08dab
1 changed files with 11 additions and 1 deletions
|
@ -7,7 +7,7 @@ use crate::{
|
|||
owner::{Storage, StorageAccess, SyncStorage},
|
||||
signal::{
|
||||
guards::{Mapped, Plain, ReadGuard},
|
||||
ArcReadSignal,
|
||||
ArcReadSignal, ArcRwSignal,
|
||||
},
|
||||
traits::{DefinedAt, Get, ReadUntracked},
|
||||
};
|
||||
|
@ -347,3 +347,13 @@ where
|
|||
ArcMemo::new(move |_| value.get())
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<ArcRwSignal<T>> for ArcMemo<T, SyncStorage>
|
||||
where
|
||||
T: Clone + PartialEq + Send + Sync + 'static,
|
||||
{
|
||||
#[track_caller]
|
||||
fn from(value: ArcRwSignal<T>) -> Self {
|
||||
ArcMemo::new(move |_| value.get())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue