Type Aliases

The following type aliases are available globally.

  • Type for a function that will be notified when the EventSource client encounters a connection failure.

    This is different from EventHandler.onError(error:) in that it will not be called for other kinds of errors; also, it has the ability to tell the client to stop reconnecting by returning a ConnectionErrorAction.shutdown.

    Declaration

    Swift

    public typealias ConnectionErrorHandler = (Error) -> ConnectionErrorAction
  • Type for a function that will take in the current HTTP headers and return a new set of HTTP headers to be used when connecting and reconnecting to a stream.

    Declaration

    Swift

    public typealias HeaderTransform = ([String : String]) -> [String : String]