Skip to content

🚀: Auto-cancel long-running jobs on State transition #210

@Nek-12

Description

@Nek-12

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions