Skip to content

Commit

Permalink
remove temporary fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Jan 16, 2024
1 parent ac77bb2 commit 21786fd
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions lib/src/_web_socket_connect/_web_socket_connect_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,6 @@ import 'dart:js_interop';

import 'package:web/helpers.dart';

// TODO(mytja): remove when https://github.com/dart-lang/web/commit/4cb5811ed06
// is in a published release and the min constraint on pkg:web is updated
/// [WebSocketEvents] is an extension to the main [WebSocket] class from
/// package:web. It adds appropriate streams while https://github.com/dart-lang/web/commit/4cb5811ed06
/// is not yet published.
extension WebSocketEvents on WebSocket {
/// [onOpen] is a [Stream], which returns [Event]s upon
/// establishing new WebSocket connection.
Stream<Event> get onOpen => EventStreamProviders.openEvent.forTarget(this);

/// [onMessage] is a [Stream], which returns [MessageEvent]s upon
/// receiving messages through the WebSocket connection.
Stream<MessageEvent> get onMessage =>
EventStreamProviders.messageEvent.forTarget(this);

/// [onClose] is a [Stream], which returns [CloseEvent]s upon
/// WebSocket closure.
Stream<CloseEvent> get onClose =>
EventStreamProviders.closeEvent.forTarget(this);

/// [onError] is a [Stream], which returns [Event]s upon error.
Stream<Event> get onError =>
EventStreamProviders.errorEventSourceEvent.forTarget(this);
}

/// Create a WebSocket connection.
Future<WebSocket> connect(
String url, {
Expand Down

0 comments on commit 21786fd

Please sign in to comment.