Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/HEAD' into changelog_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kevmoo committed Nov 22, 2023
2 parents 84dafa6 + 4cb5811 commit b747047
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## 0.4.1-wip

- Add an example.
- `helpers.dart`:
- Added event extensions for `WebSocket`

## 0.4.0

Expand Down
2 changes: 0 additions & 2 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ linter:
- avoid_bool_literals_in_conditional_expressions
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_null
- avoid_returning_null_for_future
- avoid_returning_this
- avoid_unused_constructor_parameters
- cancel_subscriptions
Expand Down
10 changes: 10 additions & 0 deletions lib/src/helpers/events/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,13 @@ extension WindowCustomEvents on Window {
Stream<TransitionEvent> get onTransitionEnd =>
CustomEventProviders.transitionEndEvent.forTarget(this);
}

extension WebSocketEvents on WebSocket {
Stream<Event> get onOpen => EventStreamProviders.openEvent.forTarget(this);
Stream<MessageEvent> get onMessage =>
EventStreamProviders.messageEvent.forTarget(this);
Stream<CloseEvent> get onClose =>
EventStreamProviders.closeEvent.forTarget(this);
Stream<Event> get onError =>
EventStreamProviders.errorEventSourceEvent.forTarget(this);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 0.4.1-wip
repository: https://github.com/dart-lang/web

environment:
sdk: ">=3.2.0-194.0.dev <4.0.0"
sdk: ^3.2.0

dev_dependencies:
analyzer: ^6.2.0
Expand Down

0 comments on commit b747047

Please sign in to comment.