From e77d48c06ab42fd926a26b52229a78d9662fff08 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 1 Nov 2018 15:56:35 +0300 Subject: SSE: switch to msg event --- vnext/src/App.js | 4 ++-- 1 file 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() { -- cgit v1.2.3