Sorci.js
    Preparing search index...

    Class SorciEvent

    This class is an helper to focus on the relevant part of your sourcing events Wich are the type of event and the data of the event.

    If you don't want to be heavily coupled with this library you could make your own implementation of it and use the type ToPersistEvent to append event and PersistedEvent to query events

    The class will genereate automatically the identifier if not provided

    Index

    Constructors

    • Parameters

      • id: string
      • type: string
      • data: Record<string, any>
      • identifier: Record<string, any>
      • timestamp: Date

      Returns SorciEvent

    Properties

    data: Record<string, any>
    id: string
    identifier: Record<string, any>
    timestamp: Date
    type: string

    Methods

    • This is used to automatically create the identifier. It retrieve every key/pair from the data object where the 'key' end with 'Id'

      Parameters

      • payload: Record<string, any>

      Returns {}