pub struct Value<T: PartialEq + 'static> { /* private fields */ }
Expand description
A reactive value. Basic building block of app state.
Can be read or written.
use vertigo::{Computed, Dependencies};
let deps = Dependencies::default();
let value = deps.new_value(5);
assert_eq!(*value.get_value(), 5);
value.set_value(10);
assert_eq!(*value.get_value(), 10);
Implementations
pub fn new_selfcomputed_value<F>(
deps: Dependencies,
value: T,
create: F
) -> Computed<T> where
F: Fn(&Value<T>) -> Box<dyn Any> + 'static,
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Value<T>
impl<T> !UnwindSafe for Value<T>
Blanket Implementations
Mutably borrows from an owned value. Read more