Handler<T extends Object?> typedef

  1. @experimental
Handler<T extends Object?> = Future<T> Function(T)

A handler function that processes a value of type T asynchronously.

Handler represents an endpoint or step in an asynchronous pipeline. It takes an input of type T and returns a Future that eventually resolves to a value of type T (possibly transformed).

Handlers can be chained together through middleware composition.

Example:

// A simple logging handler
Future<String> loggingHandler(String input) async {
  print('Processing: $input');
  return input.toUpperCase();
}

Implementation

@experimental
typedef Handler<T extends Object?> = Future<T> Function(T);