UNPKG

1.33 kBTypeScriptView Raw
1import { Connectable, ObservableInput, SubjectLike } from '../types';
2export interface ConnectableConfig<T> {
3 /**
4 * A factory function used to create the Subject through which the source
5 * is multicast. By default this creates a {@link Subject}.
6 */
7 connector: () => SubjectLike<T>;
8 /**
9 * If true, the resulting observable will reset internal state upon disconnetion
10 * and return to a "cold" state. This allows the resulting observable to be
11 * reconnected.
12 * If false, upon disconnection, the connecting subject will remain the
13 * connecting subject, meaning the resulting observable will not go "cold" again,
14 * and subsequent repeats or resubscriptions will resubscribe to that same subject.
15 */
16 resetOnDisconnect?: boolean;
17}
18/**
19 * Creates an observable that multicasts once `connect()` is called on it.
20 *
21 * @param source The observable source to make connectable.
22 * @param config The configuration object for `connectable`.
23 * @returns A "connectable" observable, that has a `connect()` method, that you must call to
24 * connect the source to all consumers through the subject provided as the connector.
25 */
26export declare function connectable<T>(source: ObservableInput<T>, config?: ConnectableConfig<T>): Connectable<T>;
27//# sourceMappingURL=connectable.d.ts.map
\No newline at end of file