AbsintheSocket constructor

AbsintheSocket(
  1. String endpoint,
  2. {AbsintheSocketOptions socketOptions}
)

Implementation

AbsintheSocket(this.endpoint, {this.socketOptions}) {
  socketOptions ??= AbsintheSocketOptions();
  subscriptionHandler = NotifierPushHandler(
      onError: _onError,
      onTimeout: _onTimeout,
      onSucceed: _onSubscriptionSucceed);
  unsubscriptionHandler = NotifierPushHandler(
      onError: _onError,
      onTimeout: _onTimeout,
      onSucceed: _onUnsubscriptionSucceed);
  _phoenixSocket = PhoenixSocket(endpoint,
      socketOptions: PhoenixSocketOptions(
          params: socketOptions.params..addAll({'vsn': '2.0.0'})));
  _connect();
}