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

Class QueryImpl

packages/vue/src/makeClient.ts:458–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458export class QueryImpl<R> {
459 readonly getRuntime: () => Context.Context<R>
460
461 constructor(
462 getRuntime: () => Context.Context<R>,
463 getAtomRt: () => AtomClientRuntime,
464 legacyUseQuery?: ReturnType<typeof makeQuery<R>>
465 ) {
466 this.getRuntime = getRuntime
467 this.useQuery = legacyUseQuery ?? makeQuery(this.getRuntime, getAtomRt)
468 this.useQueryNew = makeQueryNew(this.getRuntime, getAtomRt)
469 this.useQueryAtom = makeQueryAtom(this.getRuntime, getAtomRt)
470 this.useQueryFamily = makeQueryFamily(this.getRuntime, getAtomRt)
471 this.useStreamQuery = makeStreamQuery(this.getRuntime, getAtomRt)
472 this.useStreamQueryFamily = makeStreamQueryFamily(this.getRuntime, getAtomRt)
473 this.useStreamQueryAtom = makeStreamQueryAtom(this.getRuntime, getAtomRt)
474 this.useStreamQueryNew = makeStreamQueryNew(this.getRuntime, getAtomRt)
475 }
476 /**
477 * Effect results are passed to the caller, including errors.
478 * @deprecated use client helpers instead (.query())
479 */
480 readonly useQuery: ReturnType<typeof makeQuery<R>>
481
482 readonly useQueryNew: ReturnType<typeof makeQueryNew<R>>
483
484 readonly useQueryAtom: ReturnType<typeof makeQueryAtom<R>>
485
486 readonly useQueryFamily: ReturnType<typeof makeQueryFamily<R>>
487
488 /**
489 * Stream results are accumulated as an array of chunks and returned as reactive state.
490 * @deprecated use client helpers instead (.query())
491 */
492 readonly useStreamQuery: ReturnType<typeof makeStreamQuery<R>>
493
494 readonly useStreamQueryFamily: ReturnType<typeof makeStreamQueryFamily<R>>
495
496 readonly useStreamQueryAtom: ReturnType<typeof makeStreamQueryAtom<R>>
497
498 readonly useStreamQueryNew: ReturnType<typeof makeStreamQueryNew<R>>
499
500 /**
501 * The difference with useQuery is that this function will return a Promise you can await in the Setup,
502 * which ensures that either there always is a latest value, or an error occurs on load.
503 * So that Suspense and error boundaries can be used.
504 * @deprecated use client helpers instead (.suspense())
505 */
506 readonly useSuspenseQuery: {
507 /**
508 * The difference with useQuery is that this function will return a Promise you can await in the Setup,
509 * which ensures that either there always is a latest value, or an error occurs on load.
510 * So that Suspense and error boundaries can be used.
511 * When `I = void` the input argument may be omitted.
512 */
513 <
514 I,
515 E,

Callers

nothing calls this directly

Calls 5

makeRunPromiseFunction · 0.90
latestDefinedFunction · 0.90
useScopedSuspenseSetupFunction · 0.70
pipeMethod · 0.65
runPromiseFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…