Release Notes
What changed in each release of @remotex-labs/xobservable.
v1.1.0
Disposable subscriptions: every unsubscribe function now implements Disposable, so a subscription can be bound with a using declaration and torn down automatically when its scope exits.
ts
{
using sub = source.subscribe((value) => console.log(value));
source.next(1);
} // sub is disposed here - the subscription is torn down automaticallyAdded
UnsubscribeTypeis now(() => void) & Disposable: the function returned bysubscribeexposesSymbol.disposeand works withusingdeclarations. See Automatic cleanup withusing.- New
TeardownTypeexport: the zero-argument cleanup a handler may return from theObservableconstructor.
Changed
- Unsubscribe functions are idempotent: calling them more than once (or disposing after unsubscribing) runs the teardown at most once. See Subscribing.
- The
Observable<T>constructor handler is now typed as(observer) => TeardownType | voidinstead of returning anUnsubscribeType. BehaviorSubject.subscribeon a completed subject returns a disposable no-op instead of a plain function, sousingworks there too.
Earlier releases
- v1.0.0 - initial release (archived docs).
