Trait medea_reactive::Whenable
source · pub trait Whenable<D: 'static> {
// Required method
fn when(
&self,
assert_fn: Box<dyn Fn(&D) -> bool>
) -> LocalBoxFuture<'static, Result<(), DroppedError>>;
}
Expand description
Abstraction over ObservableField::when
and ObservableField::when_eq
implementations for custom types.
Required Methods§
sourcefn when(
&self,
assert_fn: Box<dyn Fn(&D) -> bool>
) -> LocalBoxFuture<'static, Result<(), DroppedError>>
fn when( &self, assert_fn: Box<dyn Fn(&D) -> bool> ) -> LocalBoxFuture<'static, Result<(), DroppedError>>
This function will be called on ObservableField::when
.
Should return [LocalBoxFuture
] to which will be sent ()
when
provided assert_fn
returns true
.