Fix incorrect cast causing wasm failure, prepare v4.1.4 (#96)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fef1e31..94b9848 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 4.1.4
+
+- Fix incorrect cast causing failure with `dart2wasm`.
+
## 4.1.3
- Update the minimum Dart SDK version to `3.2.0`.
diff --git a/lib/client/sse_client.dart b/lib/client/sse_client.dart
index 96cd1f3..f5be1e5 100644
--- a/lib/client/sse_client.dart
+++ b/lib/client/sse_client.dart
@@ -124,8 +124,8 @@
void _onIncomingMessage(Event message) {
var decoded =
- jsonDecode((message as MessageEvent).data as String) as String;
- _incomingController.add(decoded);
+ jsonDecode(((message as MessageEvent).data as JSString).toDart);
+ _incomingController.add(decoded as String);
}
void _onOutgoingDone() {
diff --git a/pubspec.yaml b/pubspec.yaml
index 8581f8e..f45fe3c 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: sse
-version: 4.1.3
+version: 4.1.4
description: >-
Provides client and server functionality for setting up bi-directional
communication through Server Sent Events (SSE) and corresponding POST