Skip to content

@purista/core v2.0.5


PURISTA API / @purista/core / EmitCustomMessageFunction

Type Alias: EmitCustomMessageFunction()<EmitList>

EmitCustomMessageFunction<EmitList>: <K>(eventName, payload, contentType?, contentEncoding?) => Promise<void>

Defined in: packages/core/src/core/types/EmitCustomMessageFunction.ts:12

Emits the given payload as custom message with the given event name.

Type Parameters

EmitList

Type Parameters

K extends keyof EmitSchemaList<EmitList>

Parameters

eventName

K

payload

EmitList[K]

contentType?

ContentType

contentEncoding?

string

Returns

Promise<void>

Example

typescript
await emit('my-custom-event-name', { the: 'payload' })