# @teamtv/eventstream-client-react

> React component for easy use of the teamtv eventstream-client

Latest version **1.0.13** (published 2021-09-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install @teamtv/eventstream-client-react
pnpm add @teamtv/eventstream-client-react
yarn add @teamtv/eventstream-client-react
bun add @teamtv/eventstream-client-react
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2021-09-12 |
| First published | 2019-06-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Koen Vossen |
| Maintainers | koenvossen |
| Keywords | teamtv, realtime, eventstream, react |

## Links

- npm: https://www.npmjs.com/package/@teamtv/eventstream-client-react
- Repository: https://github.com/teamtv/teamtv-eventstream-client-react
- Homepage: https://github.com/teamtv/teamtv-eventstream-client-react#readme
- Issues: https://github.com/teamtv/teamtv-eventstream-client-react/issues
- npm.io page: https://npm.io/package/@teamtv/eventstream-client-react

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^16.8.6
- [@teamtv/eventstream-client](https://npm.io/package/@teamtv/eventstream-client.md) ^1.0.11

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.13 (latest) — 2021-09-12
- 1.0.12 — 2021-09-10
- 1.0.11 — 2021-09-10
- 1.0.10 — 2021-09-10
- 1.0.9 — 2021-09-10
- 1.0.8 — 2019-08-05
- 1.0.7 — 2019-06-27
- 1.0.6 — 2019-06-23
- 1.0.5 — 2019-06-23
- 1.0.4 — 2019-06-21
- 1.0.3 — 2019-06-21
- 1.0.2 — 2019-06-21
- 1.0.1 — 2019-06-21
- 1.0.0 — 2019-06-21

## README

# EventStream Client React Component

_Simple React component for the teamtv event stream API_

## Installation

```bash
npm install --save @teamtv/eventstream-client-react
```

## Usage

```jsx
import React from 'react';
import ReactDOM from 'react-dom';

import { StatsProvider, StatsConsumer } from '@teamtv/eventstream-client-react';

const ScoreWidget = ({match, score}) => {
  return (
    <StatsConsumer types={["score"]}>
      {({match, score}) => {
        if (!match) {
          return <div>loading...</div>;
        }
        return (
          <div>
            <div>{match.homeTeam.name} - {match.awayTeam.name}</div>
            <div>{score.home} - {score.away}</div>
          </div>
        )
      }
      }
    </StatsConsumer>
  );
};

ReactDOM.render(
  <StatsProvider endpointUrl="<teamtv eventstream endpoint>">
    <ScoreWidget />
  </StatsProvider>,
  document.getElementById("app")
);


```

---
_Source: https://npm.io/package/@teamtv/eventstream-client-react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
