Trait leptos_reactive::SignalGetUntracked
source · pub trait SignalGetUntracked<T> {
// Required methods
fn get_untracked(&self) -> T;
fn try_get_untracked(&self) -> Option<T>;
}
Expand description
Trait implemented for all signal types which you can get
a value
from, such as ReadSignal
,
Memo
, etc., which allows getting the inner value without
subscribing to the current scope.
Required Methods§
sourcefn get_untracked(&self) -> T
fn get_untracked(&self) -> T
sourcefn try_get_untracked(&self) -> Option<T>
fn try_get_untracked(&self) -> Option<T>
Gets the signal’s value without creating a dependency on the
current scope. Returns [Some(T)
] if the signal is still
valid, None
otherwise.
Implementors§
impl<T: Clone> SignalGetUntracked<T> for MaybeSignal<T>
impl<T: Clone> SignalGetUntracked<T> for Memo<T>
impl<T: Clone> SignalGetUntracked<T> for Signal<T>
Please note that using Signal::with_untracked
still clones the inner value,
so there’s no benefit to using it as opposed to calling
Signal::get_untracked
.