createHookResponse<RequestType extends TrayRequest, ResultType, MetadataType extends TrayRequestMetadata> function

dynamic createHookResponse<RequestType extends TrayRequest, ResultType, MetadataType extends TrayRequestMetadata>({
  1. required RequestType request,
  2. required UseMakeRequestFetchMethod<RequestType, ResultType, MetadataType> fetch,
  3. required Future<void> refetch(
    1. Map<String, String?> overwriteParams
    ),
  4. required FetchMoreMethodType<RequestType, ResultType, MetadataType> fetchMore,
  5. MetadataType? metadata,
  6. bool loading = true,
  7. bool fetchMoreLoading = false,
  8. ResultType? data,
  9. TrayRequestError? error,
})

Implementation

createHookResponse<RequestType extends TrayRequest, ResultType,
    MetadataType extends TrayRequestMetadata>({
  required RequestType request,
  required UseMakeRequestFetchMethod<RequestType, ResultType, MetadataType>
      fetch,
  required Future<void> Function(Map<String, String?> overwriteParams) refetch,
  required FetchMoreMethodType<RequestType, ResultType, MetadataType> fetchMore,
  MetadataType? metadata,
  bool loading = true,
  bool fetchMoreLoading = false,
  ResultType? data,
  TrayRequestError? error,
}) {
  return TrayRequestHookResponse<RequestType, ResultType, MetadataType>(
    refetch: refetch,
    fetchMore: fetchMore,
    fetch: fetch,
    request: request,
    metadata: metadata,
    error: error,
    loading: loading,
    fetchMoreLoading: fetchMoreLoading,
    data: data,
  );
}