Skip to content

basalt / notifications/src / Digest

Class: Digest ​

Defined in: notifications/src/digest.ts:51

Constructors ​

Constructor ​

> new Digest(options): Digest

Defined in: notifications/src/digest.ts:55

Parameters ​

options ​

DigestOptions

Returns ​

Digest

Methods ​

collect() ​

> collect<T>(recipient, definition, ...rest): Promise<void>

Defined in: notifications/src/digest.ts:61

Render a notification and hold it for the recipient's next digest instead of sending now.

Type Parameters ​

T ​

T

Parameters ​

recipient ​

Notifiable

definition ​

NotificationDefinition<T>

rest ​

...T extends void ? [] : [T]

Returns ​

Promise<void>


flush() ​

> flush(send): Promise<number>

Defined in: notifications/src/digest.ts:83

Send each recipient's accumulated items (grouped per channel) via send, then clear. Returns batches flushed.

Parameters ​

send ​

(batch) => Promise<void>

Returns ​

Promise<number>

Released under the MIT License.