Separating Workflow Orchestration from UI Reactions in Frontend Applications

State and EventsFront-end application architecture rarely becomes messy due to one bad decision. It usually happens gradually: a view-model imports a toast library, a modal component coordinates redirects, and a notification message becomes observable state. Over time, the logic becomes scattered across different layers, components, and view-models. The boundaries between layers start to blur.But none of these decisions seem that bad on their own. The problem becomes apparent later when different view-models, components, and rendering logic manage a single workflow. This often happens because developers treat two distinct things as the same: state and events.State is usually used for things
…