# sube

> Weak subscribe to any reactive source

Latest version **2.3.0** (published 2023-12-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install sube
pnpm add sube
yarn add sube
bun add sube
```

## 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.3.0 |
| Published | 2023-12-30 |
| First published | 2022-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 9.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Dmitry Iv |
| Maintainers | dy |
| Keywords | subscribe, observable, async-iterator, rxjs, rx, promise |

## Links

- npm: https://www.npmjs.com/package/sube
- Repository: https://github.com/spectjs/sube
- Homepage: https://github.com/spectjs/sube#readme
- Issues: https://github.com/spectjs/sube/issues
- npm.io page: https://npm.io/package/sube

## Dependencies (1)

- [@preact/signals-core](https://npm.io/package/@preact/signals-core.md) ^1.5.1

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2023-12-30
- 2.2.1 — 2022-01-19
- 2.2.0 — 2022-01-19
- 2.1.0 — 2022-01-17
- 2.0.6 — 2022-01-17
- 2.0.5 — 2022-01-17
- 2.0.4 — 2022-01-17
- 2.0.3 — 2022-01-17
- 2.0.2 — 2022-01-17
- 2.0.1 — 2022-01-17
- 2.0.0 — 2022-01-17
- 1.0.3 — 2022-01-14
- 1.0.2 — 2022-01-14
- 1.0.1 — 2022-01-14

## README

# sube <a href="https://github.com/spectjs/sube/actions/workflows/test.yml"><img src="https://github.com/spectjs/sube/actions/workflows/test.yml/badge.svg"/></a> <a href="http://npmjs.org/sube"><img src="https://img.shields.io/npm/v/sube"/></a>

> Subscribe weakly to any reactive source

```js
import sub from './sube.js'

unsub = sub(source, onnext, onerror?, oncomplete?)

unsub() // unsubscribe
```

Kinds of sources:

* _Promise_, _Thenable_ (autocleanup)
* _Observable_, _Subscribable_, _Subject_ ([rxjs](https://ghub.io/rxjs), [zen-observable](https://github.com/zenparsing/zen-observable) etc.)
* _AsyncIterable_ (see [it-awesome](https://github.com/alanshaw/it-awesome))
* _Signal_ ([@preact/signals](https://ghub.io/@preact/signals), [value-ref](https://ghub.io/value-ref) etc.)
* _observ-\*_ ([observ](https://www.npmjs.com/package/observ), [observable](https://www.npmjs.com/package/observable), [mutant](https://www.npmjs.com/package/mutant))

<p align="center">🕉<p>

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