request<TData, TVars> method

  1. @override
Stream<OperationResponse<TData, TVars>> request<TData, TVars>(
  1. OperationRequest<TData, TVars> request, [
  2. NextTypedLink<TData, TVars>? forward
])
override

A function called when a request reaches this TypedLink

Implementation

@override
Stream<OperationResponse<TData, TVars>> request<TData, TVars>(
  OperationRequest<TData, TVars> request, [
  forward,
]) =>
    request.optimisticResponse == null
        ? forward!(request)
        : forward!(request).startWith(
            OperationResponse(
              operationRequest: request,
              data: request.optimisticResponse,
              dataSource: DataSource.Optimistic,
            ),
          );