publish
deprecatedReturns a connectable observable that, when connected, will multicast all values through a single underlying Subject instance.
Will be removed in v8. To create a connectable observable, use connectable.
source.pipe(publish())
is equivalent to
connectable(source, { connector: () => new Subject(), resetOnDisconnect: false })
.
If you're using refCount after publish
, use share operator instead.
source.pipe(publish(), refCount())
is equivalent to
source.pipe(share({ resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))
.
Details: https://rxjs.dev/deprecations/multicasting
Returns a connectable observable that, when connected, will multicast all values through a single underlying Subject instance.
§Return Type
Returns an observable, that when subscribed to, creates an underlying Subject,
provides an observable view of it to a selector
function, takes the observable result of
that selector function and subscribes to it, sending its values to the consumer, then connects
the subject to the original source.
§Parameters
A function used to setup multicasting prior to automatic connection.