| 456 | } |
| 457 | |
| 458 | export 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, |
nothing calls this directly
no test coverage detected
searching dependent graphs…