# reactbroadcast

> A simple lightweight react broadcast library

Latest version **0.1.1** (published 2016-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install reactbroadcast
pnpm add reactbroadcast
yarn add reactbroadcast
bun add reactbroadcast
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-10-15 |
| First published | 2016-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Chase Willden |
| Maintainers | chasewillden |
| Keywords | react, broadcast |

## Links

- npm: https://www.npmjs.com/package/reactbroadcast
- Repository: https://github.com/UndergroundCode/ReactBroadcast
- Homepage: https://github.com/UndergroundCode/ReactBroadcast#readme
- Issues: https://github.com/UndergroundCode/ReactBroadcast/issues
- npm.io page: https://npm.io/package/reactbroadcast

## 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

- 0.1.1 (latest) — 2016-10-15
- 0.1.0 — 2016-10-15

## README

# ReactBroadcast
A simple lightweight React broadcast library

# Usage
## Broadcast an Event
To broadcast an event to all components watching for the event:

```js
var ReactBroadcast = require('reactbroadcast');
ReactBroadcast.broadcast('event1', 'value1');
```
## Listen for a Broadcast
To receive the event within any component:
```js
var ReactBroadcast = require('reactbroadcast');
ReactBroadcast.on('event1', value => {
   console.log("received the value");
})
```
## Listen for a Broadcast containing
If you want to receive all values containing a certain string:
```js
var ReactBroadcast = require('reactbroadcast');
ReactBroadcast.onContains('event', value => {
   console.log("received the value");
})
```
## Get all listening names
```js
var ReactBroadcast = require('reactbroadcast');
var names = ReactBroadcast.getAllNames();
```

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