This commit is contained in:
@@ -2,7 +2,7 @@ import type * as AsyncData from "@typed/async-data"
|
||||
import { type Cause, type Context, Effect, type Fiber, Layer, type Option, type Stream, type SubscriptionRef } from "effect"
|
||||
import * as React from "react"
|
||||
import { ReffuseExtension, type ReffuseHelpers } from "reffuse"
|
||||
import type * as QueryClient from "./QueryClient.js"
|
||||
import * as QueryClient from "./QueryClient.js"
|
||||
import * as QueryRunner from "./QueryRunner.js"
|
||||
import type * as QueryService from "./QueryService.js"
|
||||
|
||||
@@ -26,10 +26,11 @@ export interface UseQueryResult<K extends readonly unknown[], A, E> {
|
||||
|
||||
export const QueryExtension = ReffuseExtension.make(() => ({
|
||||
useQuery<EH, K extends readonly unknown[], A, E, HandledE, R>(
|
||||
this: ReffuseHelpers.ReffuseHelpers<R | QueryClient.QueryClient<EH, HandledE>>,
|
||||
this: ReffuseHelpers.ReffuseHelpers<R | QueryClient.QueryClient<EH, HandledE> | EH>,
|
||||
props: UseQueryProps<K, A, E, R>,
|
||||
): UseQueryResult<K, A, Exclude<E, HandledE>> {
|
||||
const runner = this.useMemo(() => QueryRunner.make({
|
||||
QueryClient: QueryClient.makeTag<EH, HandledE>(),
|
||||
key: props.key,
|
||||
query: props.query,
|
||||
}), [props.key])
|
||||
|
||||
Reference in New Issue
Block a user