> ## 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](/api-reference/modelence/client/functions/../../../index) / [modelence](/api-reference/modelence/client/functions/../../index) / [client](/api-reference/modelence/client/functions/../index) / subscribeLiveQuery

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

Defined in: [packages/modelence/src/websocket/socketio/client.ts:112](https://github.com/modelence/modelence/blob/f614ecc6811cdda9670d612872c8ff49a49c5e28/packages/modelence/src/websocket/socketio/client.ts#L112)

## 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`
