Struct async_component_core::StateCell
source · pub struct StateCell<T> { /* private fields */ }Expand description
Track change of value and signal to StateContext.
This struct has no method and implements Deref, DerefMut.
When inner value is mutable dereferenced, it is marked changed and send signal.
This will also send signal when the cell is constructed or dropped.
Implementations§
source§impl<T> StateCell<T>
impl<T> StateCell<T>
sourcepub fn new(cx: StateContext, inner: T) -> Self
pub fn new(cx: StateContext, inner: T) -> Self
Create new StateCell with StateContext
sourcepub fn invalidate(this: &mut Self)
pub fn invalidate(this: &mut Self)
Invalidate this StateCell.
Send signal to context.