JIntent<T extends JState> class abstract

Represents an action or event that can modify application state.

The JIntent class is an abstraction that encapsulates a specific action or event that may result in a change to the application's state. This concept helps to structure the application by clearly defining the different actions and how they affect the state.

When implemented, an JIntent typically contains:

  • A method to invoke the action (run()).
  • Any parameters or dependencies required to perform the action.

Intents are used in conjunction with controllers to manage the logic and state changes within the application.

Implementers

Constructors

JIntent()

Properties

controller → JController<T>
The controller bound by the most recent invocation.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isCancelled → bool
Whether cancellation was requested for the current execution.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state → T
Provides easy access to the current state managed by the controller.
no setter

Methods

cancel() → void
Requests cooperative cancellation of the execution in progress.
invoke(JController<T> controller) → Future<void>
Wires the controller before executing the logic. Not overridable; override onInvoke instead. An instance can be reused after completion, but overlapping invocations fail with StateError before rebinding it. Invoking against a disposed controller also fails with StateError.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onInvoke() → Future<void>
Contains the core logic of the intent.
run(JController<T> controller) → Future<void>
Executes the intent. Not overridable; override onInvoke instead.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

current → JIntent<JState>?
The intent whose onInvoke is executing in the current zone, or null.
no setter