# react-xstream-hoc

> A utility to make React components easily consume xstream streams

Latest version **1.1.0** (published 2020-03-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-xstream-hoc
pnpm add react-xstream-hoc
yarn add react-xstream-hoc
bun add react-xstream-hoc
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-03-04 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 33.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | staltz.com |
| Maintainers | staltz |

## Links

- npm: https://www.npmjs.com/package/react-xstream-hoc
- Homepage: https://github.com/staltz/react-xstream-hoc
- npm.io page: https://npm.io/package/react-xstream-hoc

## Dependencies (3)

- [react](https://npm.io/package/react.md) >=16.0.0
- [xstream](https://npm.io/package/xstream.md) >=11
- [@types/react](https://npm.io/package/@types/react.md) >=16.0.0

## Recent versions

- 1.1.0 (latest) — 2020-03-04
- 1.0.0 — 2019-01-10

## README

# react-xstream-hoc

```
npm install --save react-xstream-hoc
```

A utility function (higher-order component, 'HOC') that takes a React component as input, and returns a React component that behaves like the input but knows how to listen to [xstream](https://github.com/staltz/xstream) streams from props.

## What problem this package solves

Let's say you have a normal React component that accepts normal props:

```jsx
<MyComponent isBlue={true} />
```

But you want the component to accept `isBlue` as an xstream stream, and have that component automatically listen to the stream and update accordingly.

## Usage

```js
import {withXstreamProps} from 'react-xstream-hoc';

const MyXSComponent = withXstreamProps(MyComponent, 'isBlue');

// ... then in a render function ...
<MyXSComponent isBlue={obs} />
```

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