Seed<TData>.lazy constructor
const
Seed<TData>.lazy (
- TData? resolve()
Seeds the query cache with the value returned by resolve.
Because seeds only apply while the query has no data, the callback is
never invoked once the cache is populated, so expensive lookups are
skipped. Returning null means there is no seed after all; the
callback may run again on a later mount while the query is still
empty.
Example:
seed: Seed.lazy(() => client.getQueryData(['users'])?.firstOrNull)
Implementation
const factory Seed.lazy(TData? Function() resolve) = SeedLazy<TData>._;