Libraries like Workflow, Formula, and Elmslie allow long-running jobs to be intrinsically tied to a specific state type. When the state changes, any jobs scoped to the previous state are automatically cancelled.
Ideas:
- Add an extension to FlowMVI's job manager that ties a launched job's lifecycle to the current state type.
- Example: If a store transitions from
State.Content to State.Error, any jobs tied to State.Content are automatically cleaned up.
- This would prevent stale jobs from emitting obsolete data when the UI has already moved to a new state.