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

Function makeQueryAtom

packages/vue/src/query.ts:543–562  ·  view source on GitHub ↗
(_getRuntime: () => Context.Context<R>, getAtomRt: () => AtomClientRuntime)

Source from the content-addressed store, hash-verified

541 if (refetchInterval !== undefined) next = Atom.withRefresh(refetchInterval)(next)
542 const gcTime = options?.idleTTL ?? options?.gcTime
543 if (gcTime === "infinity") return Atom.keepAlive(next)
544 if (gcTime !== undefined) return Atom.setIdleTTL(next, gcTime)
545 return next
546}
547
548const queryAtomFor = <I, A, E, TData>(
549 rt: AtomClientRuntime,
550 q: QueryFamilyDescriptor<I, A, E>,
551 arg: I,
552 options?: Omit<AtomQueryNewOptions<A, TData>, "select"> | Omit<CustomUseQueryOptions<A, E, TData>, "select">
553): Atom.Atom<AsyncResult.AsyncResult<A, E>> => {
554 const family = getQueryFamily(rt, q)
555 return observedAtom(family(arg), options)
556}
557
558const makeQueryView = <I, A, E, TData>(
559 getAtomRt: () => AtomClientRuntime,
560 q: QueryFamilyDescriptor<I, A, E>,
561 arg: I | WatchSource<I> | undefined | WatchSource<Option.Option<I>>,
562 options?: (AtomQueryNewOptions<A, TData> | CustomUseQueryOptions<A, E, TData>) & {
563 readonly mode?: "optional"
564 }
565): QueryView<TData, E> => {

Callers 1

constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…