@teamtv/eventstream-client

1.0.11 • Public • Published

EventStream Client

Simple Client for the teamtv event stream API

Installation

npm install --save @teamtv/eventstream-client

Usage

import { EventStream, SSEEventStreamSource } from '@teamtv/eventstream-client';

const es = new EventStream(
  new SSEEventStreamSource("<teamtv eventstream endpoint>")
);

es.on("shot", (attributes) => {
  if (attributes.result === "GOAL") {
    console.log("Shot", attributes);
  }
});

Package Sidebar

Install

npm i @teamtv/eventstream-client

Weekly Downloads

0

Version

1.0.11

License

ISC

Unpacked Size

8.67 kB

Total Files

4

Last publish

Collaborators

  • koenvossen