Skip to main content

ActionEvent

This event is emitted for each log() an action makes. diff names what the action was running for: the context of its model, overlay or resource, and the diff's action and field.

@group

Events/Action

Hierarchy

  • Event<{ diff: { action: DiffAction; field: string; node: string }; message: string; metadata: Record<string, unknown> }>
    • ActionEvent

Index

Constructors

Properties

Constructors

constructor

  • ActionEvent(name?: string, payload?: { diff: { action: DiffAction; field: string; node: string }; message: string; metadata: Record<string, unknown> }): ActionEvent
  • Parameters

    • optionalname: string

      The subject of the event, when the event type alone does not identify it.

    • optionalpayload: { diff: { action: DiffAction; field: string; node: string }; message: string; metadata: Record<string, unknown> }

      The event's data.

      • diff: { action: DiffAction; field: string; node: string }
      • message: string
      • metadata: Record<string, unknown>

    Returns ActionEvent

Properties

readonlyinheritedheader

header: { sequence: number; timestamp: number }

When the event was created. sequence counts every event this process created, so it orders two events created in the same millisecond, and events a late listener receives replayed.


Type declaration

  • sequence: number
  • timestamp: number

readonlyinheritedname

name: string

The subject of the event, when the event type alone does not identify it - e.g. the class name on a registration event. Empty otherwise.

readonlyinheritedpayload

payload: { diff: { action: DiffAction; field: string; node: string }; message: string; metadata: Record<string, unknown> }

The event's data. Its shape is fixed by the event type.


Type declaration

  • diff: { action: DiffAction; field: string; node: string }
  • message: string
  • metadata: Record<string, unknown>
Page Options