leptos::reactive::preludeTrait ReadOptional
Source pub trait ReadOptional: DefinedAt {
type Value;
// Required method
fn try_read(&self) -> Option<Self::Value>;
// Provided method
fn read(&self) -> Self::Value { ... }
}
Expand description
An alternative Read
trait that works with Option<Readable>
types.
The guard type that will be returned, which can be dereferenced to the value.
Subscribes to the signal, and returns the guard, or None
if the signal has already been disposed.
Subscribes to the signal, and returns the guard.
§Panics
Panics if you try to access a signal that has been disposed.