# Function: share()

> 

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

Defined in: [packages/server/src/observable/operators.ts:37](https://github.com/trpc/trpc/blob/57482b0bb09dce5c838dc8bf5727a943488bac61/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`\>
