Skip to main content
Module

x/rxjs/mod.ts>multicast

Deno port of RXJS
Latest
function multicast
Deprecated
Deprecated

Will be removed in v8. To create a connectable observable, use connectable. If you're using refCount after multicast, use the share operator instead. multicast(subject), refCount() is equivalent to share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }). Details: https://rxjs.dev/deprecations/multicasting

import { multicast } from "https://deno.land/x/rxjs@v1.0.2/mod.ts";

An operator that creates a ConnectableObservable, that when connected, with the connect method, will use the provided subject to multicast the values from the source to all consumers.

Parameters

subject: Subject<T>

The subject to multicast through.

Because this is deprecated in favor of the connect operator, and was otherwise poorly documented, rather than duplicate the effort of documenting the same behavior, please see documentation for the connect operator.

Parameters

subject: Subject<T>

The subject used to multicast.

selector: (shared: Observable<T>) => O

A setup function to setup the multicast

Returns

A function that returns an observable that mirrors the observable returned by the selector.

An operator that creates a ConnectableObservable, that when connected, with the connect method, will use the provided subject to multicast the values from the source to all consumers.

Parameters

subjectFactory: () => Subject<T>

A factory that will be called to create the subject. Passing a function here will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of the source.

Because this is deprecated in favor of the connect operator, and was otherwise poorly documented, rather than duplicate the effort of documenting the same behavior, please see documentation for the connect operator.

Parameters

subjectFactory: () => Subject<T>

A factory that creates the subject used to multicast.

selector: (shared: Observable<T>) => O

A function to setup the multicast and select the output.

Returns

A function that returns an observable that mirrors the observable returned by the selector.