added lazy query support

fixed possible race condition of simultanous refetches of the same query
This commit is contained in:
Kingkor Roy Tirtho
2022-06-09 13:33:39 +06:00
parent 9bcdfc9db7
commit 547cf65dd8
4 changed files with 88 additions and 5 deletions
@@ -8,6 +8,10 @@ class QueryJob<T extends Object, Outside> {
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;
@@ -22,5 +26,6 @@ class QueryJob<T extends Object, Outside> {
this.staleTime,
this.onData,
this.onError,
this.enabled,
});
}