aboutsummaryrefslogtreecommitdiff
path: root/vnext
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-11-01 15:56:35 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commite77d48c06ab42fd926a26b52229a78d9662fff08 (patch)
tree49eb1166a392744e46b5d0f1813e2a24d5f8a365 /vnext
parent29c872a86a14e0f16b1cb114c514ef624d2e63bf (diff)
SSE: switch to msg event
Diffstat (limited to 'vnext')
-rw-r--r--vnext/src/App.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/vnext/src/App.js b/vnext/src/App.js
index 5397a4b7..5726c511 100644
--- a/vnext/src/App.js
+++ b/vnext/src/App.js
@@ -44,7 +44,7 @@ export default class App extends React.Component {
this.es.onopen = () => {
console.log('online');
};
- this.es.onmessage = (msg) => {
+ this.es.addEventListener('msg', msg => {
try {
var jsonMsg = JSON.parse(msg.data);
console.log('data: ' + msg.data);
@@ -66,7 +66,7 @@ export default class App extends React.Component {
} catch (err) {
console.log(err);
}
- };
+ });
}
componentDidMount() {