sube
v2.3.0
Published
Weak subscribe to any reactive source
Downloads
55
Maintainers
Readme
sube
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)