Options
All
  • Public
  • Public/Protected
  • All
Menu

Any error against opening a stream for this class will have an error telling the user to look at the network response which is why we prefer the ReaderEventStream/ReadableStream approach. Beyond that, this type of EventStream works the same and can still reconnect. Note: It may be worth it to just ditch EventStream and use XMLHttpRequest instead which would be low-level but may offer more control on the initial request and avoids the double request in FetchStreamTransport.

Hierarchy

Implements

  • EventStream

Index

Constructors

constructor

  • new EventSourceEventStream(evtSrc: EventSource, onOpen: function, onOpenError: function, reconnecter?: undefined | function): EventSourceEventStream

Properties

Protected closed

closed: boolean

Protected events

events: Array<Event>

Private evtSrc

evtSrc: EventSource

Protected Optional lastErr

lastErr: undefined | string

Protected listeners

listeners: Array<EventListener>

Private onOpenError

onOpenError: function

Type declaration

    • (error: Error): void
    • Parameters

      • error: Error

      Returns void

Private openedOnce

openedOnce: boolean

Static Protected RETRY_TIMEOUT_MILLIS

RETRY_TIMEOUT_MILLIS: number

Methods

addListener

  • addListener(listener: EventListener): void
  • Parameters

    • listener: EventListener

    Returns void

afterClose

  • afterClose(): void

close

  • close(): void
  • Returns void

nextEvent

  • nextEvent(): Promise<Event>
  • Returns Promise<Event>

Protected onReconnect

open

  • open(): void

Protected poll

  • poll(): void
  • Returns void

Protected reconnect

  • reconnect(error?: Error): void
  • Parameters

    Returns void

removeListener

  • removeListener(listener: EventListener): void
  • Parameters

    • listener: EventListener

    Returns void

Private reset

  • reset(): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc