UNPKG

4 kBTypeScriptView Raw
1import { Subject } from '../Subject';
2import { Observable } from '../Observable';
3import { ConnectableObservable } from '../observable/ConnectableObservable';
4import { OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';
5/**
6 * An operator that creates a {@link ConnectableObservable}, that when connected,
7 * with the `connect` method, will use the provided subject to multicast the values
8 * from the source to all consumers.
9 *
10 * @param subject The subject to multicast through.
11 * @return A function that returns a {@link ConnectableObservable}
12 * @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
13 * If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
14 * `multicast(subject), refCount()` is equivalent to
15 * `share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
16 * Details: https://rxjs.dev/deprecations/multicasting
17 */
18export declare function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
19/**
20 * Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
21 * rather than duplicate the effort of documenting the same behavior, please see documentation for the
22 * {@link connect} operator.
23 *
24 * @param subject The subject used to multicast.
25 * @param selector A setup function to setup the multicast
26 * @return A function that returns an observable that mirrors the observable returned by the selector.
27 * @deprecated Will be removed in v8. Use the {@link connect} operator instead.
28 * `multicast(subject, selector)` is equivalent to
29 * `connect(selector, { connector: () => subject })`.
30 * Details: https://rxjs.dev/deprecations/multicasting
31 */
32export declare function multicast<T, O extends ObservableInput<any>>(subject: Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
33/**
34 * An operator that creates a {@link ConnectableObservable}, that when connected,
35 * with the `connect` method, will use the provided subject to multicast the values
36 * from the source to all consumers.
37 *
38 * @param subjectFactory A factory that will be called to create the subject. Passing a function here
39 * will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of
40 * the source.
41 * @return A function that returns a {@link ConnectableObservable}
42 * @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
43 * If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
44 * `multicast(() => new BehaviorSubject('test')), refCount()` is equivalent to
45 * `share({ connector: () => new BehaviorSubject('test') })`.
46 * Details: https://rxjs.dev/deprecations/multicasting
47 */
48export declare function multicast<T>(subjectFactory: () => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
49/**
50 * Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
51 * rather than duplicate the effort of documenting the same behavior, please see documentation for the
52 * {@link connect} operator.
53 *
54 * @param subjectFactory A factory that creates the subject used to multicast.
55 * @param selector A function to setup the multicast and select the output.
56 * @return A function that returns an observable that mirrors the observable returned by the selector.
57 * @deprecated Will be removed in v8. Use the {@link connect} operator instead.
58 * `multicast(subjectFactory, selector)` is equivalent to
59 * `connect(selector, { connector: subjectFactory })`.
60 * Details: https://rxjs.dev/deprecations/multicasting
61 */
62export declare function multicast<T, O extends ObservableInput<any>>(subjectFactory: () => Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
63//# sourceMappingURL=multicast.d.ts.map
\No newline at end of file