Trait leptos::SignalGetUntracked

source ·
pub trait SignalGetUntracked {
    type Value;

    // Required methods
    fn get_untracked(&self) -> Self::Value;
    fn try_get_untracked(&self) -> Option<Self::Value>;
}
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 Associated Types§

source

type Value

The value held by the signal.

Required Methods§

source

fn get_untracked(&self) -> Self::Value

Gets the signal’s value without creating a dependency on the current scope.

§Panics

Panics if you try to access a signal that is owned by a reactive node that has been disposed.

source

fn try_get_untracked(&self) -> Option<Self::Value>

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§

source§

impl<T> SignalGetUntracked for MaybeSignal<T>
where T: Clone,

§

type Value = T

source§

impl<T> SignalGetUntracked for MaybeProp<T>
where T: Clone,

§

type Value = Option<T>

source§

impl<T> SignalGetUntracked for Memo<T>
where T: Clone,

§

type Value = T

source§

impl<T> SignalGetUntracked for ReadSignal<T>
where T: Clone,

§

type Value = T

source§

impl<T> SignalGetUntracked for RwSignal<T>
where T: Clone,

§

type Value = T

source§

impl<T> SignalGetUntracked for Signal<T>
where T: Clone,

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.

§

type Value = T