# @flexbase/observable-subject

> Observable subject event bus

Latest version **2.1.2** (published 2023-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @flexbase/observable-subject
pnpm add @flexbase/observable-subject
yarn add @flexbase/observable-subject
bun add @flexbase/observable-subject
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.2 |
| Published | 2023-12-06 |
| First published | 2022-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Flexbase Technologies |
| Maintainers | chris.fowlkes, drbobbeaty, peilong-du, knoxcoder |
| Keywords | flexbase, observable, subject, event-bus, event, bus |

## Links

- npm: https://www.npmjs.com/package/@flexbase/observable-subject
- Repository: https://github.com/flexbase-eng/observable-subject
- Homepage: https://github.com/flexbase-eng/observable-subject#readme
- Issues: https://github.com/flexbase-eng/observable-subject/issues
- npm.io page: https://npm.io/package/@flexbase/observable-subject

## Dependencies (1)

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

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.1.2 (latest) — 2023-12-06
- 2.1.0-beta.22 (beta) — 2023-04-26
- 2.1.1 — 2023-04-26
- 2.1.0-beta.21 — 2023-04-26
- 2.1.0-beta.20 — 2023-04-26
- 2.1.0 — 2023-03-27
- 2.0.1 — 2023-03-21
- 2.0.0 — 2023-03-21
- 1.4.3-beta.15 — 2023-03-21
- 1.4.3 — 2023-03-17
- 1.4.2 — 2023-03-17
- 1.4.1 — 2023-03-17
- 1.4.0 — 2023-03-17
- 0.0.0-semantic-release — 2023-03-17
- 0.0.0-semantic-release-beta.14 — 2023-03-17
- … 10 more at https://npm.io/package/@flexbase/observable-subject/versions

## README

# observable-subject

[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_observable-subject&metric=coverage)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_observable-subject)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=flexbase-eng_observable-subject&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=flexbase-eng_observable-subject)

Observable subject event bus

## Installation

```
npm install @flexbase/observable-subject
```

or

```
yarn add @flexbase/observable-subject
```

## Usage

```ts
import { Subject, subjectManager } from '@flexbase/observable-subject';

// create a subject
const subject: Subject = { key: Symbol() };

// register the subject
await subjectManager.register(subject);

// subscribe to the subject
const subscription = subjectManager.subscribe<number>(subject, async context => {
  await new Promise(_ => setTimeout(_, context.value));
});

// notify subscriptions
await subjectManager.notify(subject, { value: 1000 });

// unsubscribe
subscription.unsubscribe();
```

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