Awesome
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
import sub from './sube.js'
unsub = sub(source, onnext, onerror?, oncomplete?)
unsub() // unsubscribe
Kinds of sources:
- Promise, Thenable (autocleanup)
- Observable, Subscribable, Subject (rxjs, zen-observable etc.)
- AsyncIterable (see it-awesome)
- Signal (@preact/signals, value-ref etc.)
- observ-* (observ, observable, mutant)