React hook for data fetching that bridges TanStack Query with Legend-State. Returns query state as an Observable, and accepts Observable values anywhere in the options — including individual elements inside queryKey. When an observable value changes, the query automatically re-fetches.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
When an element inside queryKey is an Observable, the query automatically re-fetches whenever its value changes. Use .peek() in queryFn to read the current value without registering an extra reactive dependency.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
Custom hook that bridges TanStack Query with Legend-State.
Manages query state as an observable using QueryObserver.
Accepts DeepMaybeObservable<UseQueryOptions>, supporting an Observable
for the entire options object or for individual fields. Elements inside
the queryKey array can also be Observables and will react to changes automatically.
queryFn and .peek() — Always use .peek() (not .get()) inside queryFn when reading observable values. Using .get() would register reactive dependencies and cause unexpected re-renders.
Observable state fields — All returned fields are Observable. To read them in a reactive component, call .get(). For non-reactive reads (e.g. event handlers), use .peek().
Cache key identity — Observable elements in queryKey are resolved to their plain values before being passed to TanStack Query. The cache key is always a plain array, matching TanStack’s standard behavior.
staleTime and caching — When queryKey changes, TanStack decides whether to fetch fresh data or serve from cache based on staleTime. No manual refetch() is needed on key changes.