copyWith method
QueryOptions<T>
copyWith({
- List<
Object> ? queryKey, - QueryFetcher<
T> ? queryFn, - Duration? staleTime,
- Duration? cacheTime,
- RetryConfig? retryConfig,
- bool? refetchOnWindowFocus,
- bool? refetchOnReconnect,
- bool? refetchOnMount,
- bool? enabled,
- T? initialData,
- T? placeholderData,
- bool? keepPreviousData,
- bool? structuralSharing,
- void onSuccess(
- T data
- void onError(
- Object error
- void onSettled(
- T? data,
- Object? error
- R select<
R>( - T data
- NetworkMode? networkMode,
- Map<
String, dynamic> ? meta,
Implementation
QueryOptions<T> copyWith({
List<Object>? queryKey,
QueryFetcher<T>? queryFn,
Duration? staleTime,
Duration? cacheTime,
RetryConfig? retryConfig,
bool? refetchOnWindowFocus,
bool? refetchOnReconnect,
bool? refetchOnMount,
bool? enabled,
T? initialData,
T? placeholderData,
bool? keepPreviousData,
bool? structuralSharing,
void Function(T data)? onSuccess,
void Function(Object error)? onError,
void Function(T? data, Object? error)? onSettled,
R Function<R>(T data)? select,
NetworkMode? networkMode,
Map<String, dynamic>? meta,
}) {
return QueryOptions<T>(
queryKey: queryKey ?? this.queryKey,
queryFn: queryFn ?? this.queryFn,
staleTime: staleTime ?? this.staleTime,
cacheTime: cacheTime ?? this.cacheTime,
retryConfig: retryConfig ?? this.retryConfig,
refetchOnWindowFocus: refetchOnWindowFocus ?? this.refetchOnWindowFocus,
refetchOnReconnect: refetchOnReconnect ?? this.refetchOnReconnect,
refetchOnMount: refetchOnMount ?? this.refetchOnMount,
enabled: enabled ?? this.enabled,
initialData: initialData ?? this.initialData,
placeholderData: placeholderData ?? this.placeholderData,
keepPreviousData: keepPreviousData ?? this.keepPreviousData,
structuralSharing: structuralSharing ?? this.structuralSharing,
onSuccess: onSuccess ?? this.onSuccess,
onError: onError ?? this.onError,
onSettled: onSettled ?? this.onSettled,
select: select ?? this.select,
networkMode: networkMode ?? this.networkMode,
meta: meta ?? this.meta,
);
}