ZenQueryConfig<T> constructor

const ZenQueryConfig<T>({
  1. Duration staleTime = const Duration(seconds: 30),
  2. Duration cacheTime = const Duration(minutes: 5),
  3. RefetchBehavior refetchOnMount = RefetchBehavior.ifStale,
  4. RefetchBehavior refetchOnFocus = RefetchBehavior.never,
  5. RefetchBehavior refetchOnReconnect = RefetchBehavior.ifStale,
  6. NetworkMode networkMode = NetworkMode.online,
  7. Duration? refetchInterval,
  8. bool enableBackgroundRefetch = false,
  9. int retryCount = 3,
  10. Duration retryDelay = const Duration(milliseconds: 200),
  11. RetryDelayFn? retryDelayFn,
  12. Duration maxRetryDelay = const Duration(seconds: 30),
  13. double retryBackoffMultiplier = 2.0,
  14. bool exponentialBackoff = true,
  15. bool retryWithJitter = true,
  16. bool autoPauseOnBackground = false,
  17. bool refetchOnResume = false,
  18. bool persist = false,
  19. T fromJson(
    1. Map<String, dynamic> json
    )?,
  20. Map<String, dynamic> toJson(
    1. T data
    )?,
  21. ZenStorage? storage,
  22. T? placeholderData,
})

Implementation

const ZenQueryConfig({
  this.staleTime = const Duration(seconds: 30),
  this.cacheTime = const Duration(minutes: 5),
  this.refetchOnMount = RefetchBehavior.ifStale,
  this.refetchOnFocus = RefetchBehavior.never,
  this.refetchOnReconnect = RefetchBehavior.ifStale,
  this.networkMode = NetworkMode.online,
  this.refetchInterval,
  this.enableBackgroundRefetch = false,
  this.retryCount = 3,
  this.retryDelay = const Duration(milliseconds: 200),
  this.retryDelayFn,
  this.maxRetryDelay = const Duration(seconds: 30),
  this.retryBackoffMultiplier = 2.0,
  this.exponentialBackoff = true,
  this.retryWithJitter = true,
  this.autoPauseOnBackground = false,
  this.refetchOnResume = false,
  this.persist = false,
  this.fromJson,
  this.toJson,
  this.storage,
  this.placeholderData,
});