copyWith method

TrayRequestHookResponse<RequestType, ResultType, MetadataType> copyWith({
  1. bool? loading,
  2. bool? fetchMoreLoading,
  3. MetadataType? metadata,
  4. ResultType? data,
  5. TrayRequestError? error,
  6. RequestType? request,
  7. UseMakeRequestFetchMethod<RequestType, ResultType, MetadataType>? fetch,
  8. Future<void> refetch(
    1. Map<String, String?> overwriteParams
    )?,
  9. FetchMoreMethodType<RequestType, ResultType, MetadataType>? fetchMore,
})

Implementation

TrayRequestHookResponse<RequestType, ResultType, MetadataType> copyWith({
  bool? loading,
  bool? fetchMoreLoading,
  MetadataType? metadata,
  ResultType? data,
  TrayRequestError? error,
  RequestType? request,
  UseMakeRequestFetchMethod<RequestType, ResultType, MetadataType>? fetch,
  Future<void> Function(Map<String, String?> overwriteParams)? refetch,
  FetchMoreMethodType<RequestType, ResultType, MetadataType>? fetchMore,
}) {
  return TrayRequestHookResponse(
    refetch: refetch ?? this.refetch,
    fetchMore: fetchMore ?? this.fetchMore,
    fetch: fetch ?? this.fetch,
    request: request ?? this.request,
    metadata: metadata ?? this.metadata,
    error: error ?? this.error,
    loading: loading ?? this.loading,
    fetchMoreLoading: fetchMoreLoading ?? this.fetchMoreLoading,
    data: data ?? this.data,
  );
}