Trait Get

pub trait Get: DefinedAt {
    type Value: Clone;

    // Required method
    fn try_get(&self) -> Option<Self::Value>;

    // Provided method
    fn get(&self) -> Self::Value { ... }
}
Expand description

Clones the value of the signal, without tracking the value reactively. and subscribes the active reactive observer (an effect or computed) to changes in its value.

Required Associated Types§

type Value: Clone

The type of the value contained in the signal.

Required Methods§

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

Subscribes to the signal, then clones and returns the value of the signal, or None if the signal has already been disposed.

Provided Methods§

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

Subscribes to the signal, then clones and returns the value of the signal.

§Panics

Panics if you try to access a signal that has been disposed.

Implementors§

§

impl<T> Get for Option<T>
where Option<T>: DefinedAt, T: Get,

§

type Value = Option<<T as Get>::Value>

§

impl<T> Get for T
where T: With, <T as With>::Value: Clone,

§

type Value = <T as With>::Value