0.0.0 • Published 6 years ago

eventsource-sk v0.0.0

Weekly downloads
3
License
-
Repository
-
Last release
6 years ago
curl 'http://localhost:3000/signalk/v1/api/' -H 'Accept: text/event-stream' -H 'Connection: keep-alive'
const merge = require('lodash.merge')
let state = {};
new EventSource('http://localhost:3000/signalk/v1/api/').onmessage = function(event) {
  const data = JSON.stringify(event.data);
  state = merge(state, data)
  console.log('New state:', state)
};