• Parses line buffers into EventSourceMessages.

    Parameters

    • Optional onMessage: ((msg) => void)

      A function that will be called on each message.

    • Optional onId: ((id) => void)

      A function that will be called on each id field.

        • (id): void
        • Parameters

          • id: string

          Returns void

    • Optional onRetry: ((retry) => void)

      A function that will be called on each retry field.

        • (retry): void
        • Parameters

          • retry: number

          Returns void

    Returns ((line, fieldLength, flush?) => void)

    A function that should be called for each incoming line buffer.

      • (line, fieldLength, flush?): void
      • Parameters

        • line: Uint8Array
        • fieldLength: number
        • Optional flush: boolean

        Returns void

Generated using TypeDoc