# @repeaterjs/pubsub

> A generic pubsub class, implemented with repeaters

Latest version **0.3.4** (published 2019-11-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @repeaterjs/pubsub
pnpm add @repeaterjs/pubsub
yarn add @repeaterjs/pubsub
bun add @repeaterjs/pubsub
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.4 |
| Published | 2019-11-10 |
| First published | 2019-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 482 |
| Maintainers | brainkim |

## Links

- npm: https://www.npmjs.com/package/@repeaterjs/pubsub
- Repository: https://github.com/repeaterjs/repeater
- npm.io page: https://npm.io/package/@repeaterjs/pubsub

## Dependencies (1)

- [@repeaterjs/repeater](https://npm.io/package/@repeaterjs/repeater.md) ^3.0.0

## Recent versions

- 0.3.4 (latest) — 2019-11-10
- 0.3.3 — 2019-11-10
- 0.3.2 — 2019-10-13
- 0.3.1 — 2019-08-29
- 0.3.0 — 2019-08-24
- 0.2.1 — 2019-08-22

## README

# @repeater/pubusb
This package is experimental!

A generic pubsub class, implemented with repeaters

For more information, visit [repeater.js.org](https://repeater.js.org).

```ts
interface PubSub<T> {
  publish(topic: string, value: T): Promise<void> | void;
  unpublish(topic: string, reason?: any): Promise<void> | void;
  subscribe(topic: string, buffer?: RepeaterBuffer<T>): AsyncIterableIterator<T>;
  close(reason?: any): Promise<void> | void;
}

class InMemoryPubSub<T> implements PubSub<T> {
  publish(topic: string, value: T): void;
  unpublish(topic: string, reason?: any): void;
  subscribe(topic: string, buffer?: RepeaterBuffer<T>): Repeater<T>;
  close(reason?: any): void;
}
```

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