Placeholder<TData>.lazy constructor

const Placeholder<TData>.lazy(
  1. TData? resolve(
    1. TData? previous
    )
)

Shows the value returned by resolve while the query is pending.

The callback receives the data of the last query this observer had data for, or null if there is none. This enables keeping the previous query's data on screen while a new query key is fetching:

placeholder: Placeholder.lazy((previous) => previous)

Returning null means there is no placeholder and the query stays pending.

Implementation

const factory Placeholder.lazy(
  TData? Function(TData? previous) resolve,
) = PlaceholderLazy<TData>._;