merge method

ZenQueryConfig<T> merge(
  1. ZenQueryConfig<T>? other
)

Merge with another config (explicit fields on other take precedence, while omitted fields on other preserve this config's values).

Implementation

ZenQueryConfig<T> merge(ZenQueryConfig<T>? other) {
  if (other == null) return this;

  return ZenQueryConfig<T>(
    staleTime: other._staleTime ?? _staleTime,
    cacheTime: other._cacheTime ?? _cacheTime,
    refetchOnMount: other._refetchOnMount ?? _refetchOnMount,
    refetchOnFocus: other._refetchOnFocus ?? _refetchOnFocus,
    refetchOnReconnect: other._refetchOnReconnect ?? _refetchOnReconnect,
    networkMode: other._networkMode ?? _networkMode,
    refetchInterval: other.refetchInterval ?? refetchInterval,
    enableBackgroundRefetch:
        other._enableBackgroundRefetch ?? _enableBackgroundRefetch,
    retryCount: other._retryCount ?? _retryCount,
    retryDelay: other._retryDelay ?? _retryDelay,
    retryDelayFn: other.retryDelayFn ?? retryDelayFn,
    maxRetryDelay: other._maxRetryDelay ?? _maxRetryDelay,
    retryBackoffMultiplier:
        other._retryBackoffMultiplier ?? _retryBackoffMultiplier,
    exponentialBackoff: other._exponentialBackoff ?? _exponentialBackoff,
    retryWithJitter: other._retryWithJitter ?? _retryWithJitter,
    retryWhenOnline: other._retryWhenOnline ?? _retryWhenOnline,
    autoPauseOnBackground:
        other._autoPauseOnBackground ?? _autoPauseOnBackground,
    refetchOnResume: other._refetchOnResume ?? _refetchOnResume,
    persist: other._persist ?? _persist,
    fromJson: other.fromJson ?? fromJson,
    toJson: other.toJson ?? toJson,
    storage: other.storage ?? storage,
    placeholderData: other.placeholderData ?? placeholderData,
  );
}