JRestartableIntentDispatcher class

Dispatcher that cancels the running intent with the same key when a new one arrives for the same controller, then starts the new intent immediately.

Useful for search-as-you-type or any "latest wins" flow. Cancellation is cooperative (see JIntent.cancel): the superseded intent keeps running until it returns, but JController.update ignores its state updates and it can stop early by checking JIntent.isCancelled. Its future still reports its own result or error, and observers receive onIntentCancelled instead of onIntentDispatched when it finishes. By default the key is the intent's runtimeType. Intents with different keys run concurrently.

Implemented types

Constructors

JRestartableIntentDispatcher({JIntentKey? keyOf})

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispatch<T extends JState>(JIntent<T> intent, JController<T> controller) → Future<void>
Dispatches the given intent to the provided controller.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited