connect method

  1. @override
Stream<SSEResponse> connect(
  1. String connectionId,
  2. SSERequest request, {
  3. dynamic fromJson(
    1. dynamic
    )?,
})
override

Establishes a connection with the server.

connectionId is the unique identifier for the connection. request is the SSE request containing the connection details. fromJson is an optional function to parse the JSON data.

Returns a Stream of SSEResponse objects.

Implementation

@override
Stream<SSEResponse> connect(String connectionId, SSERequest request,
    {Function(dynamic)? fromJson}) {
  return subscribeToSSE(connectionId, request, fromJson: fromJson);
}