# UseReactorMethodResult

Defined in: [react/src/hooks/useActorMethod.ts:99](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L99)

Result type for useActorMethod hook.
Provides a unified interface for both query and mutation methods.

## Type Parameters

### Service

`Service` = [`BaseActor`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/baseactor/)

### Method

`Method` *extends* [`FunctionName`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functionname/)\<`Service`\> = [`FunctionName`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functionname/)\<`Service`\>

### Transform

`Transform` *extends* [`TransformKey`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/transformkey/) = `"candid"`

## Properties

### data

> **data**: [`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\> \| `undefined`

Defined in: [react/src/hooks/useActorMethod.ts:109](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L109)

The returned data from the method call. A method's `undefined` result is
`null` here, as in `useActorQuery`, so `undefined` only means no call has
settled yet.

***

### isLoading

> **isLoading**: `boolean`

Defined in: [react/src/hooks/useActorMethod.ts:113](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L113)

Whether the method is currently executing

***

### isPending

> **isPending**: `boolean`

Defined in: [react/src/hooks/useActorMethod.ts:116](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L116)

Alias for isLoading - whether a mutation is pending

***

### isError

> **isError**: `boolean`

Defined in: [react/src/hooks/useActorMethod.ts:119](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L119)

Whether there was an error

***

### isSuccess

> **isSuccess**: `boolean`

Defined in: [react/src/hooks/useActorMethod.ts:122](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L122)

Whether the method has successfully completed at least once

***

### error

> **error**: [`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\> \| `null`

Defined in: [react/src/hooks/useActorMethod.ts:125](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L125)

The error if one occurred

***

### isQuery

> **isQuery**: `boolean`

Defined in: [react/src/hooks/useActorMethod.ts:128](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L128)

Whether this is a query method (true) or mutation method (false)

***

### functionType

> **functionType**: [`FunctionType`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/functiontype/)

Defined in: [react/src/hooks/useActorMethod.ts:131](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L131)

The function type (query, update, composite_query)

***

### call

> **call**: (`args?`) => `Promise`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\> \| `undefined`\>

Defined in: [react/src/hooks/useActorMethod.ts:138](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L138)

Call the method with optional arguments.
For queries: triggers a refetch
For mutations: executes the mutation with the provided args

#### Parameters

##### args?

[`ReactorArgs`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargs/)\<`Service`, `Method`, `Transform`\>

#### Returns

`Promise`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\> \| `undefined`\>

***

### reset

> **reset**: () => `void`

Defined in: [react/src/hooks/useActorMethod.ts:152](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L152)

Reset the state (data and error).
For queries: resets this hook's own cache entry to its initial state, so
`data` goes back to `initialData` when one was given and is cleared
otherwise. An enabled hook then refetches. Other args of the same method
are left alone.
For mutations: resets the mutation state

#### Returns

`void`

***

### refetch

> **refetch**: () => `Promise`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\> \| `undefined`\>

Defined in: [react/src/hooks/useActorMethod.ts:157](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L157)

For queries only: Refetch the query

#### Returns

`Promise`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\> \| `undefined`\>

***

### queryResult?

> `optional` **queryResult?**: `UseQueryResult`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>, [`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\>\>

Defined in: [react/src/hooks/useActorMethod.ts:163](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L163)

The raw query result (only available for query methods)

***

### mutationResult?

> `optional` **mutationResult?**: `UseMutationResult`\<[`ReactorQueryData`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorquerydata/)\<[`ReactorReturnOk`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnok/)\<`Service`, `Method`, `Transform`\>\>, [`ReactorReturnErr`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorreturnerr/)\<`Service`, `Method`, `Transform`\>, [`ReactorArgs`](https://ic-reactor.b3pay.net/v3/libs/type-aliases/reactorargs/)\<`Service`, `Method`, `Transform`\>\>

Defined in: [react/src/hooks/useActorMethod.ts:169](https://github.com/B3Pay/ic-reactor/blob/70bedf3c8779611a3b35710510442dee7f630b87/packages/react/src/hooks/useActorMethod.ts#L169)

The raw mutation result (only available for mutation methods)