IFClite TypeScript API
    Preparing search index...

    Function createEventLog

    • The viewer's side: its stream, the numbers it gives the events it posts on a port, and the last MAX_RESUME_EVENTS of them. Shared by the viewer and fakeViewer, so both resume the same way.

      Parameters

      • Optionalstream: string

      Returns {
          head: number;
          stream: string;
          after(from: ResumePoint): LoggedEvent[];
          record(type: string, snapshot: unknown): number;
      }

      • Readonlyhead: number

        The number of the last event recorded; 0 before the first. The next event gets head + 1.

      • stream: string
      • after: function
      • record: function
        • Keep an event the port took, as the number head + 1; returns that number. Pass the snapshot that was posted (structuredClone of the caller's payload, taken once before posting), so a resend is exactly the event as posted, whatever the caller's object does later. Record only after the post succeeded: a post that failed (or a payload that could not be snapshotted) takes no number and is not kept.

          Parameters

          • type: string
          • snapshot: unknown

          Returns number