Skip to main content

StateFilesSavingEvent

This event is emitted before state files are written. A listener that returns a promise is awaited, and may add files to stateFiles, which are then written in the same change.

@group

Events/State

Hierarchy

Index

Constructors

Properties

Constructors

constructor

  • StateFilesSavingEvent(name?: string, payload?: { stateFiles: ({ data: Buffer<ArrayBufferLike> | undefined; stateFileName: string } | { filePath: string; stateFileName: string })[] }): StateFilesSavingEvent
  • Parameters

    • optionalname: string

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

    • optionalpayload: { stateFiles: ({ data: Buffer<ArrayBufferLike> | undefined; stateFileName: string } | { filePath: string; stateFileName: string })[] }

      The event's data.

      • stateFiles: ({ data: Buffer<ArrayBufferLike> | undefined; stateFileName: string } | { filePath: string; stateFileName: string })[]

    Returns StateFilesSavingEvent

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: { stateFiles: ({ data: Buffer<ArrayBufferLike> | undefined; stateFileName: string } | { filePath: string; stateFileName: string })[] }

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


Type declaration

  • stateFiles: ({ data: Buffer<ArrayBufferLike> | undefined; stateFileName: string } | { filePath: string; stateFileName: string })[]
Page Options