(options?: {
readonly staleTime?: number
readonly gcTime?: number | "infinity"
readonly idleTTL?: number | "infinity"
readonly refetchOnWindowFocus?: boolean
readonly revalidateOnFocus?: boolean
readonly structuralSharing?: boolean
readonly refetchInterval?: number
readonly refreshEvery?: number
})
| 257 | readonly structuralSharing?: boolean |
| 258 | readonly refreshEvery?: number |
| 259 | readonly refetchInterval?: number |
| 260 | readonly live?: boolean | LiveQueryOptions |
| 261 | readonly invalidation?: QueryInvalidationMode |
| 262 | readonly select?: (data: TQueryFnData) => TData |
| 263 | } |
| 264 | |
| 265 | export interface AtomStreamQueryOptions { |
| 266 | readonly staleTime?: number |
| 267 | readonly idleTTL?: number | "infinity" |
| 268 | readonly gcTime?: number | "infinity" |
| 269 | readonly revalidateOnFocus?: boolean |
| 270 | readonly refetchOnWindowFocus?: boolean |
| 271 | readonly refreshEvery?: number |
| 272 | readonly live?: boolean | LiveQueryOptions |
| 273 | readonly refetchInterval?: number |
| 274 | } |
| 275 | |
| 276 | /** |
| 277 | * Layer TanStack `initialData` / `placeholderData` over a raw query result as a DISPLAY fallback. |
| 278 | * Only while the result is still `Initial` (pending, never settled): show `initialData` as resolved |
| 279 | * data, or `placeholderData` as provisional (`waiting: true`). Once real data exists the seed is |
| 280 | * dropped. Failures are never masked — including failures without `previousSuccess` (where |
| 281 | * `AsyncResult.value` is empty). `placeholderData` in function form receives the last seen concrete |
| 282 | * value for basic keep-previous across input changes. Returns the raw ref untouched when neither |
| 283 | * option is set. Neither value is written to the atom cache. |
| 284 | */ |
| 285 | export const withDataFallback = <A, E>( |
| 286 | // Structural read so both Ref and Readonly<Ref> from useAtomValue are accepted. |
| 287 | rawResult: { readonly value: AsyncResult.AsyncResult<A, E> }, |
| 288 | options?: unknown |
no outgoing calls
no test coverage detected
searching dependent graphs…