addEventType abstract method

void addEventType(
  1. String event
)

Adds the given event type to the stream for listening.

After adding the event, all further instances of that event that are sent by the server will be emitted by this stream. You can use ServerSentEvent.event to find out which data belongs to which event type when processing them.

Calling this function multiple times for the same event does nothing. You can listen to multiple different events at the same time.

To remove an added event, you can use removeEventType.

Implementation

void addEventType(String event);