pub trait SignalWithUntracked<T> {
    // Required methods
    fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> O;
    fn try_with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Option<O>;
}
Expand description

This trait allows getting a reference to the signals inner value without creating a dependency on the signal.

Required Methods§

source

fn with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> O

Runs the provided closure with a reference to the current value without creating a dependency on the current scope.

Panics

Panics if you try to access a signal that was created in a Scope that has been disposed.

source

fn try_with_untracked<O>(&self, f: impl FnOnce(&T) -> O) -> Option<O>

Runs the provided closure with a reference to the current value without creating a dependency on the current scope. Returns [Some(O)] if the signal is still valid, None otherwise.

Implementors§