A class to listen to Fauna streams.

Type Parameters

Constructors

Properties

Accessors

Methods

Constructors

Properties

closed: boolean = false

Whether or not this stream has been closed

Accessors

  • get last_ts(): undefined | number
  • Returns undefined | number

Methods

  • A synchronous method to start listening to the stream and handle events using callbacks.

    Parameters

    • onEvent: ((event: StreamEventData<T> | StreamEventStatus) => void)

      A callback function to handle each event

    • OptionalonError: ((error: Error) => void)

      An Optional callback function to handle errors. If none is provided, error will not be handled, and the stream will simply end.

        • (error): void
        • Parameters

          • error: Error

          Returns void

    Returns void