query reusability by QueryJob
QueryJob.task External Data Support Query task is now pure function Query.data is non-nullable (even the type)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
|
||||
// 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,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user