jsx-view
Version:
Minimal JSX for HTML DOM tightly integrated with RxJS. TypeScript definitions, and attributes can be assigned to observables.
19 lines • 882 B
TypeScript
import { Subscription } from "rxjs";
import type { Observable } from "rxjs";
/**
* ### `subscribeState` helper
*
* Note: I'm using "closed" & "unsubscribed" interchangeably below.
*
* Helper provides your next function another subscription which will be closed each time obs emits.
*
* This is especially useful for creating nesting subscribers that should be closed anytime there is a new emission.
*
* This is common when subscribing to a "state" or "view" observable, because each `next` emitted value
* essentially means that everything dependent on the previous value should be disposed of (closed / unsubscribed),
* hence the name `subscribeState`.
*/
export declare function subscribeState<T>(
/** if */
parentSub: Subscription, obs: Observable<T>, next: (value: T, subscriptionUntilNext: Subscription) => void): void;
//# sourceMappingURL=subscribeState.d.ts.map