[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/broadcasting](../README) / PendingBroadcast

# Class: PendingBroadcast

Defined in: [broadcasting/src/PendingBroadcast.ts:9](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/broadcasting/src/PendingBroadcast.ts#L9)

A deferred broadcast returned by `broadcast(event)`. It is thenable and sends automatically on
the next microtask (or immediately when awaited), so `.toOthers()` can configure it first.

## Implements

- `PromiseLike`\<`void`\>

## Constructors

### Constructor

> **new PendingBroadcast**(`event`): `PendingBroadcast`

Defined in: [broadcasting/src/PendingBroadcast.ts:13](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/broadcasting/src/PendingBroadcast.ts#L13)

#### Parameters

##### event

[`BroadcastEvent`](../interfaces/BroadcastEvent)

#### Returns

`PendingBroadcast`

## Methods

### toOthers()

> **toOthers**(): `this`

Defined in: [broadcasting/src/PendingBroadcast.ts:19](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/broadcasting/src/PendingBroadcast.ts#L19)

Exclude the connection that originated the triggering request (its `X-Socket-ID`), so the
user who just made an optimistic update doesn't receive a duplicate.

#### Returns

`this`

***

### send()

> **send**(): `void`

Defined in: [broadcasting/src/PendingBroadcast.ts:25](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/broadcasting/src/PendingBroadcast.ts#L25)

Send now (idempotent). Called automatically on microtask / await.

#### Returns

`void`

***

### then()

> **then**\<`TResult1`, `TResult2`\>(`onfulfilled?`, `onrejected?`): `PromiseLike`\<`TResult1` \| `TResult2`\>

Defined in: [broadcasting/src/PendingBroadcast.ts:32](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/broadcasting/src/PendingBroadcast.ts#L32)

Attaches callbacks for the resolution and/or rejection of the Promise.

#### Type Parameters

##### TResult1

`TResult1` = `void`

##### TResult2

`TResult2` = `never`

#### Parameters

##### onfulfilled?

((`value`) => `TResult1` \| `PromiseLike`\<`TResult1`\>) \| `null`

The callback to execute when the Promise is resolved.

##### onrejected?

((`reason`) => `TResult2` \| `PromiseLike`\<`TResult2`\>) \| `null`

The callback to execute when the Promise is rejected.

#### Returns

`PromiseLike`\<`TResult1` \| `TResult2`\>

A Promise for the completion of which ever callback is executed.

#### Implementation of

`PromiseLike.then`
