Skip to content

Commit

Permalink
Refactor actor hooks to update return types from UseSharedCallReturnT…
Browse files Browse the repository at this point in the history
…ype to UseQueryCallReturnType and UseUpdateCallReturnType
  • Loading branch information
b3hr4d committed Nov 30, 2024
1 parent 9c3656c commit 532b257
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/react/src/context/actor/hooks/useQueryCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import type {
FunctionName,
UseQueryCall,
UseQueryCallParameters,
UseSharedCallReturnType,
UseQueryCallReturnType,
} from "../../../types"

/**
* Hook for making query calls to actors. It supports automatic refetching on component mount and at specified intervals.
*
* @param args {@link UseQueryCallParameters}.
* @returns object {@link UseSharedCallReturnType}.
* @returns object {@link UseQueryCallReturnType}.
* @example
* ```tsx
* function QueryCallComponent() {
Expand All @@ -37,6 +37,6 @@ import type {
export function useQueryCall<
A = BaseActor,
M extends FunctionName<A> = FunctionName<A>
>(args: UseQueryCallParameters<A, M>): UseSharedCallReturnType<A, M> {
>(args: UseQueryCallParameters<A, M>): UseQueryCallReturnType<A, M> {
return (ActorHooks.useQueryCall as UseQueryCall<A>)(args)
}
6 changes: 3 additions & 3 deletions packages/react/src/context/actor/hooks/useUpdateCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import type {
FunctionName,
UseUpdateCall,
UseUpdateCallParameters,
UseSharedCallReturnType,
UseUpdateCallReturnType,
} from "../../../types"

/**
* Hook for making update calls to actors, handling loading states, and managing errors. It supports custom event handlers for loading, success, and error events.
*
* @param args {@link UseUpdateCallParameters}.
* @returns object {@link UseSharedCallReturnType}.
* @returns object {@link UseUpdateCallReturnType}.
* @example
* ```tsx
* function UpdateCallComponent() {
Expand All @@ -38,6 +38,6 @@ import type {
export function useUpdateCall<
A = BaseActor,
M extends FunctionName<A> = FunctionName<A>
>(args: UseUpdateCallParameters<A, M>): UseSharedCallReturnType<A, M> {
>(args: UseUpdateCallParameters<A, M>): UseUpdateCallReturnType<A, M> {
return (ActorHooks.useUpdateCall as UseUpdateCall<A>)(args)
}

0 comments on commit 532b257

Please sign in to comment.