# zen-push

> An Observable push stream

Latest version **0.3.1** (published 2022-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install zen-push
pnpm add zen-push
yarn add zen-push
bun add zen-push
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2022-10-28 |
| First published | 2017-08-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/zen-push) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | zenparsing |

## Links

- npm: https://www.npmjs.com/package/zen-push
- Repository: https://github.com/zenparsing/zen-push
- Issues: https://github.com/zenparsing/zen-push/issues
- npm.io page: https://npm.io/package/zen-push

## Dependencies (1)

- [zen-observable](https://npm.io/package/zen-observable.md) ^0.9.0

## Recent versions

- 0.3.1 (latest) — 2022-10-28
- 0.3.0 — 2022-10-28
- 0.2.1 — 2017-12-20
- 0.2.0 — 2017-12-11
- 0.1.4 — 2017-10-23
- 0.1.3 — 2017-10-17
- 0.1.2 — 2017-08-15
- 0.1.1 — 2017-08-14
- 0.1.0 — 2017-08-14

## README

# zen-push

A push stream observable class. *(Sometimes called a Subject in Rx-speak.)*

## Install

```sh
npm install zen-push
```

## Usage

```js
import PushStream from 'zen-push';

let pushStream = new PushStream();
pushStream.observable.subscribe(value => console.log(`Hello ${value}!`));
pushStream.next('World'); // 'Hello World!'
```

## API

### new PushStream()

```js
let pushStream = new PushStream();
```

Creates a new `PushStream` object.

### pushStream.observable

```js
pushStream.observable.subscribe(value => console.log(`Hello ${value}!`));
```

The instance of [Observable](https://github.com/tc39/proposal-observable) used to listen to elements in the push stream.

### pushStream.next(value)

```js
pushStream.next('World');
```

Sends the next stream value to all observers.

### pushStream.error(error)

```js
pushStream.error(new Error('The planet as been destroyed'));
```

Sends an error to all observers. Calling this method terminates the stream.

### pushStream.complete()

```js
pushStream.complete();
```

Sends a signal to all observers that the stream is finished. Calling this method terminates the stream.

### PushStream.multicast(observable)

```js
let multicastObservable = PushStream.multicast(observable);
multicastObservable.subscribe(console.log);
multicastObservable.subscribe(console.log);
```

Uses a `PushStream` to send an observable's values to multiple subscribers.

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