Trait hirola_core::effect::SideEffect
source · pub trait SideEffect<Attr: EffectAttribute<Handler = Self>, Effect, Node> {
// Required method
fn effect(&self, node: &Node, attr: Attr, effect: Effect);
}
Expand description
Trait for defining side effects.
The SideEffect
trait allows defining asynchronous side effects that are executed as futures.
Implementations of this trait should represent tasks that need to be performed concurrently
with the rendering process, such as making HTTP requests, updating global state, or scheduling
timers.
When used in conjunction with the Dom
, side effects can be attached to specific DOM nodes and
executed during the rendering process, ensuring proper handling of asynchronous operations
within the frontend application.