intent method

Future<void> intent(
  1. JIntent<T> intent
)

Handles a given JIntent to update the state.

Invokes the logic encapsulated in the intent and applies any state changes. Returns a failed future with StateError after disposal. Dispatchers that implement JPendingIntentCancellation reject pending tasks on disposal; already running work is not interrupted. Await or handle the returned future, including disposal cancellations.

Implementation

Future<void> intent(JIntent<T> intent) {
  if (!mounted) {
    return Future<void>.error(StateError('JController has been disposed.'));
  }
  return _dispatcher.dispatch(intent, this);
}