# @21epub/rxjs-event-bus

> > Made with create-storybook-react-library

Latest version **0.1.4** (published 2021-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @21epub/rxjs-event-bus
pnpm add @21epub/rxjs-event-bus
yarn add @21epub/rxjs-event-bus
bun add @21epub/rxjs-event-bus
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2021-07-22 |
| First published | 2020-12-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 86.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | 21epub |
| Maintainers | gary.guzy, zhangwei0126, dxsix, liqiuliepub, wagon1104, xuyucheng, ongyuxing |
| Keywords | typescript |

## Links

- npm: https://www.npmjs.com/package/@21epub/rxjs-event-bus
- Repository: https://github.com/21epub/rxjs-event-bus
- Issues: https://github.com/21epub/rxjs-event-bus/issues
- npm.io page: https://npm.io/package/@21epub/rxjs-event-bus

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) 6.6.3
- [eventemitter3](https://npm.io/package/eventemitter3.md) 4.0.7

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2021-07-22
- 0.1.2 — 2021-01-29
- 0.1.1 — 2020-12-28
- 0.1.0 — 2020-12-27
- 0.0.4 — 2020-12-26
- 0.0.3 — 2020-12-25
- 0.0.2 — 2020-12-25

## README

# @21epub/rxjs-event-bus

> Made with create-storybook-react-library

[![NPM](https://img.shields.io/npm/v/@21epub/rxjs-event-bus.svg)](https://www.npmjs.com/package/@21epub/rxjs-event-bus) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://img.shields.io/travis/com/21epub/rxjs-event-bus)](https://travis-ci.com/github/21epub/rxjs-event-bus) [![Codecov](https://img.shields.io/codecov/c/github/21epub/rxjs-event-bus)](https://codecov.io/gh/21epub/rxjs-event-bus)

## Intro

This is a module for event management.

## Feature

- [x] Easy-to-use
- [x] Typescript Support
- [x] Rxjs
- [ ] Hooks support

## Install

```bash
npm install --save @21epub/rxjs-event-bus
```

## Usage

```ts
import RxBus from '@21epub/rxjs-event-bus'

// create instance
const rxBus = new RxBus()

// register events
rxBus.register<string>('event1')

// or register batch of events
rxBus.register<string>(['event1', 'event2'])

// subscribe to a event just like using rxjs subject
rxBus.subject('event1').subscribe((result) => console.log(result))

// tigger event
rxBus.subject('event1').next('ok')

// support Sync Event
rxBus.register('syncEvent', 'SyncSubject')
rxBus.syncSubject('syncEvent').subscribe((result) => console.log(result)) // something
rxBus.syncSubject('syncEvent').next('something')
```

## Developing and running on localhost

First install dependencies and then install peerDeps for storybook dev:

```sh
npm install
```

To run Example in hot module reloading mode:

```sh
npm start   # or npm run storybook
```

To create a bundle library module build:

```sh
npm run build
```

## Testing

To run unit tests:

```sh
npm test
```

## License

MIT © [21epub](https://github.com/21epub)

---
_Source: https://npm.io/package/@21epub/rxjs-event-bus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
