registerFunction<TResponse, TRequest extends Request<TResponse>> method

void registerFunction<TResponse, TRequest extends Request<TResponse>>(
  1. FutureOr<TResponse> handler(
    1. TRequest
    )
)

Registers the given handler.

This will create a function based request handler.

See RequestHandler.function.

Implementation

void registerFunction<TResponse, TRequest extends Request<TResponse>>(
  FutureOr<TResponse> Function(TRequest) handler,
) {
  register(RequestHandler.function(handler));
}