OnErrorCallback<P> typedef

OnErrorCallback<P> = FutureOr<void> Function(Object error, P params, dynamic context)

Lifecycle hook invoked when a mutation throws an error.

Receives the thrown error, the original params of type P, and the optional context returned by OnMutateCallback.

OnErrorCallback<CreateTaskParams> onError = (err, params, context) {
  showToast('Failed to create task: $err');
};

Implementation

typedef OnErrorCallback<P> = FutureOr<void> Function(
    Object error, P params, dynamic context);