UNPKG

1.99 kBTypeScriptView Raw
1import { Subject } from '../Subject';
2import { Observable } from '../Observable';
3import { Subscription } from '../Subscription';
4/**
5 * @class ConnectableObservable<T>
6 * @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
7 * If you are using the `refCount` method of `ConnectableObservable`, use the {@link share} operator
8 * instead.
9 * Details: https://rxjs.dev/deprecations/multicasting
10 */
11export declare class ConnectableObservable<T> extends Observable<T> {
12 source: Observable<T>;
13 protected subjectFactory: () => Subject<T>;
14 protected _subject: Subject<T> | null;
15 protected _refCount: number;
16 protected _connection: Subscription | null;
17 /**
18 * @param source The source observable
19 * @param subjectFactory The factory that creates the subject used internally.
20 * @deprecated Will be removed in v8. Use {@link connectable} to create a connectable observable.
21 * `new ConnectableObservable(source, factory)` is equivalent to
22 * `connectable(source, { connector: factory })`.
23 * When the `refCount()` method is needed, the {@link share} operator should be used instead:
24 * `new ConnectableObservable(source, factory).refCount()` is equivalent to
25 * `source.pipe(share({ connector: factory }))`.
26 * Details: https://rxjs.dev/deprecations/multicasting
27 */
28 constructor(source: Observable<T>, subjectFactory: () => Subject<T>);
29 protected getSubject(): Subject<T>;
30 protected _teardown(): void;
31 /**
32 * @deprecated {@link ConnectableObservable} will be removed in v8. Use {@link connectable} instead.
33 * Details: https://rxjs.dev/deprecations/multicasting
34 */
35 connect(): Subscription;
36 /**
37 * @deprecated {@link ConnectableObservable} will be removed in v8. Use the {@link share} operator instead.
38 * Details: https://rxjs.dev/deprecations/multicasting
39 */
40 refCount(): Observable<T>;
41}
42//# sourceMappingURL=ConnectableObservable.d.ts.map
\No newline at end of file