Files
fl-query/packages/fl_query/lib/models/query_job.dart
T
Kingkor Roy Tirtho 547cf65dd8 added lazy query support
fixed possible race condition of simultanous refetches of the same query
2022-06-09 13:33:39 +06:00

32 lines
736 B
Dart

import 'package:fl_query/query.dart';
class QueryJob<T extends Object, Outside> {
// all params
final String queryKey;
QueryTaskFunction<T, Outside> task;
final int? retries;
final Duration? retryDelay;
final T? initialData;
/// If set to false then the initial fetch will not be called & to
/// start the process the user has to call the refetch first
final bool? enabled;
// got from global options
final Duration? staleTime;
final QueryListener<T>? onData;
final QueryListener<dynamic>? onError;
QueryJob({
required this.queryKey,
required this.task,
this.retries,
this.retryDelay,
this.initialData,
this.staleTime,
this.onData,
this.onError,
this.enabled,
});
}