> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modelence.com/llms.txt
> Use this file to discover all available pages before exploring further.

# subscribeLiveQuery

[API Reference](https://docs.modelence.com/api-reference/modelence/client/functions/../../../index) / [modelence](https://docs.modelence.com/api-reference/modelence/client/functions/../../index) / [client](https://docs.modelence.com/api-reference/modelence/client/functions/../index) / subscribeLiveQuery

> **subscribeLiveQuery**\<`T`>(`method`, `args`, `onData`, `onError?`): () => `void`

Defined in: [packages/modelence/src/websocket/socketio/client.ts:126](https://github.com/modelence/modelence/blob/main/packages/modelence/src/websocket/socketio/client.ts#L126)

## Type Parameters

| Type Parameter | Default type |
| - | - |
| `T` | `unknown` |

## Parameters

| Parameter | Type |
| - | - |
| `method` | `string` |
| `args` | `Record`\<`string`, `unknown`> |
| `onData` | (`data`) => `void` |
| `onError?` | (`error`) => `void` |

## Returns

> (): `void`

### Returns

`void`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.