# @push.rocks/smartrx

> A smart wrapper for rxjs to manage and extend observables.

Latest version **3.0.12** (published 2026-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @push.rocks/smartrx
pnpm add @push.rocks/smartrx
yarn add @push.rocks/smartrx
bun add @push.rocks/smartrx
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.12 |
| Published | 2026-07-16 |
| First published | 2023-07-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 33.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Lossless GmbH |
| Maintainers | lossless |
| Keywords | rxjs, wrapper, observables, event emitter, stream processing, reactive programming, backpressure, event handling |

## Links

- npm: https://www.npmjs.com/package/@push.rocks/smartrx
- Repository: https://code.foss.global/push.rocks/smartrx
- Homepage: https://code.foss.global/push.rocks/smartrx#readme
- Issues: https://code.foss.global/push.rocks/smartrx/issues
- npm.io page: https://npm.io/package/@push.rocks/smartrx

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) ^7.8.1
- [@push.rocks/smartpromise](https://npm.io/package/@push.rocks/smartpromise.md) ^4.0.2

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

- 3.0.12 (latest) — 2026-07-16
- 3.0.11 — 2026-07-16
- 3.0.10 — 2025-04-25
- 3.0.7 — 2023-11-01
- 3.0.6 — 2023-07-24
- 3.0.5 — 2023-07-24
- 3.0.3 — 2023-07-12
- 3.0.2 — 2023-07-12

## README

# @push.rocks/smartrx

smart wrapper for rxjs

## Issue Reporting and Security

For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.

## Install

To install `@push.rocks/smartrx`, run the following command in your terminal:

```bash
pnpm add @push.rocks/smartrx
```

This package is distributed via npm and should be saved as a dependency in your project's `package.json` file once installed.

## Usage

`@push.rocks/smartrx` provides a smart wrapper for working with RxJS, enhancing its already powerful reactive programming capabilities with additional functionalities, including easier observable map management and observable intake handling. We'll explore key features and how to use them in TypeScript.

First, ensure you're working in an environment configured for TypeScript and modern JavaScript development.

### Basic Setup

To start using `@push.rocks/smartrx`, first, import what you need from the package:

```typescript
import { Observablemap, ObservableIntake, rxjs } from '@push.rocks/smartrx';
```

### Observable Map Management

`Observablemap` helps manage observables efficiently, especially useful when you need to ensure a single observable per event or when working with event emitters.

#### Basic Observablemap Use

```typescript
import { Observablemap } from '@push.rocks/smartrx';
import { EventEmitter } from 'events';

// Initialize Observablemap
const observableMap = new Observablemap();

// Your event emitter (node.js events in this case)
const myEmitter = new EventEmitter();

// Get a Subject for a specific event
const myEventSubject = observableMap.getSubjectForEmitterEvent(myEmitter, 'myEvent');

// Subscribe to the Subject
myEventSubject.subscribe({
  next: (value) => console.log(`Received value: ${value}`),
});

// Emit events
myEmitter.emit('myEvent', 'Hello World!');
```

This approach ensures that you have a single observable (Subject in this case) per event, efficiently reusing existing observables instead of creating new ones for the same event.

### Observable Intake

`ObservableIntake` is designed for efficiently managing and controlling the flow of data through observables, offering features like buffering and intake requests.

#### Using ObservableIntake

```typescript
import { ObservableIntake } from '@push.rocks/smartrx';

// Initialize ObservableIntake
const observableIntake = new ObservableIntake<string>();

// Listen to the observableIntake as you would with any RxJS Observable
observableIntake.subscribe({
  next: (message) => console.log(message),
  complete: () => console.log('No more messages'),
});

// Push messages into the observable intake
observableIntake.push('Hello');
observableIntake.push('World');

// Signal completion
observableIntake.signalComplete();
```

`ObservableIntake` offers the flexibility of adding values as they come and controlling when those values are emitted to subscribers, including buffering capabilities for managing backpressure.

#### Advanced Use-cases

`@push.rocks/smartrx` also supports working with Node.js streams.

- **From Streams with Backpressure**: Efficiently create observables from Node.js streams, applying backpressure as needed.

### Conclusion

`@push.rocks/smartrx` significantly simplifies some of the more tedious aspects of working with RxJS, making it easier to manage observables related to event emitters and providing helpful utilities like observable intake for controlling data flow. With its smart wrappers, developers can focus more on business logic rather than boilerplate code for observable management.

Remember, reactive programming with RxJS is a powerful paradigm that can make handling asynchronous data streams simpler and more maintainable. `@push.rocks/smartrx` enhances this paradigm by providing tools that make working with RxJS even more pleasant and productive.

## License and Legal Information

This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the repository license file.

**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

### Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.

Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.

### Company Information

Task Venture Capital GmbH<br>
Registered at District Court Bremen HRB 35230 HB, Germany

For any legal inquiries or further information, please contact us via email at hello@task.vc.

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

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