An open API service indexing awesome lists of open source software.

https://github.com/dy/sube

Subscribe to any reactive source, weakly
https://github.com/dy/sube

Last synced: 3 months ago
JSON representation

Subscribe to any reactive source, weakly

Awesome Lists containing this project

README

          

# sube

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

🕉