observable-event-source
RxJS Observable from server sent event stream
this is not production quality software and is supported only on a best-effort basis through github, use at your own risk
usage
const observableEventSource = const o = consoleo
api
observableEventSource(options: Object) => Observable<String|Object>
Options:
url
:String, required - location of the Server-Sent Events feedjson
:Boolean, defaultfalse
- iftrue
, event data is parsed as JSON
Returns an instance of Observable
, which has all kinds of features that are beyond the scope of this readme.
Each SSE data:
item is returned as en element of the observable sequence. Event names are ignored in this version.
installation
$ npm install observable-event-source
running the tests
From package root:
$ npm install
$ npm test
contributors
- jden jason@denizac.org
license
ISC. (c) MMXVI jden jason@denizac.org. See LICENSE.md