diff options
author | Vitaly Takmazov | 2018-11-01 15:56:35 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | e77d48c06ab42fd926a26b52229a78d9662fff08 (patch) | |
tree | 49eb1166a392744e46b5d0f1813e2a24d5f8a365 | |
parent | 29c872a86a14e0f16b1cb114c514ef624d2e63bf (diff) |
SSE: switch to msg event
-rw-r--r-- | vnext/src/App.js | 4 |
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() { |