# Function: share()

> 

> **share**\<`TValue`, `TError`\>(`_opts`?): `MonoTypeOperatorFunction`\<`TValue`, `TError`\>

Defined in: [packages/server/src/observable/operators.ts:37](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/server/src/observable/operators.ts#L37)

Shares one subscription to the source between all subscribers. It
starts with the first subscriber and ends when the last unsubscribes.

## Type Parameters

| Type Parameter |
| ------ |
| `TValue` |
| `TError` |

## Parameters

| Parameter | Type |
| ------ | ------ |
| `_opts`? | `ShareConfig` |

## Returns

`MonoTypeOperatorFunction`\<`TValue`, `TError`\>
