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