pub trait ToComputed<T: Clone> {
// Required method
fn to_computed(&self) -> Computed<T>;
}Expand description
A trait allowing converting the type into computed.
use vertigo::{ToComputed, transaction};
let comp_1 = 5.to_computed();
let comp_2 = 'x'.to_computed();
let comp_3 = false.to_computed();
transaction(|context| {
assert_eq!(comp_1.get(context), 5);
assert_eq!(comp_2.get(context), 'x');
assert_eq!(comp_3.get(context), false);
});