generated from yumemi-inc/multiplatform-library-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Description
Summary
Introduce an explicit API in the Store {} DSL to cancel pending/queued dispatches from inside handlers.
This is an alternative (or complement) to policy-based behavior discussed in #164.
Motivation
In some flows, the app should explicitly discard already-queued actions at a specific point (for example, after reaching a terminal state or after handling a one-shot action).
A local, explicit DSL call can be easier to reason about than only having a global queue policy.
Proposal
Add a function available from relevant DSL scopes:
- Preferred name:
cancelPendingActions() - Alternative names:
cancelQueuedDispatches(),clearActionQueue()
Example
state<MyState.Active> {
action<MyAction.Finish> {
cancelPendingActions()
nextState(MyState.Done)
}
}Relationship to #164
- Related issue: #164 Proposal: pending dispatch policy on state transitions
- Proposal: pending dispatch policy on state transitions #164 focuses on queue policy during state transitions.
- This issue proposes an explicit API that can be called at the exact point where cancellation is needed.
Both approaches could be implemented independently or combined.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels