MCPcopy Create free account
hub / github.com/effect-app/libs / normalizeQueryOptions

Function normalizeQueryOptions

packages/vue/src/query.ts:259–285  ·  view source on GitHub ↗
(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
})

Source from the content-addressed store, hash-verified

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
265export 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 */
285export 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

Callers 2

observedAtomFunction · 0.85
makeQueryViewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…