Type Alias StateHandlerFn

Source
pub type StateHandlerFn = dyn Fn(StateHandlerInput<'_>) + Send + Sync;
Expand description

A StateHandlerFn is a function that handles state changes for a component.

The rule of execution order is:

  1. Children’s state handlers are executed earlier than parent’s.
  2. Newer components’ state handlers are executed earlier than older ones.

Acutally, rule 2 includes rule 1, because a newer component is always a child of an older component :)