Skip to content

,System.Linq.Expressions.Expression{System.Func{System.IObservable{--0},System.IObservable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{System.IObservable{--0},System.IObservable{--1}}},--0)}

Qbservable.Publish(IQbservable, Expression, IObservable>>) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<TResult> Publish<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, IObservable<TResult>>> selector)
  • 2. public static IQbservable<TResult> Publish<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, IObservable<TResult>>> selector, TSource initialValue)

1. Overload

public static IQbservable<TResult> Publish<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, IObservable<TResult>>> selector)

Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence. This operator is a specialization of Multicast using a regular Subject.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence whose elements will be multicasted through a single shared subscription.
selectorExpression, IObservable>>Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.

Returns: IQbservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

See also

2. Overload

public static IQbservable<TResult> Publish<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, IObservable<TResult>>> selector, TSource initialValue)

Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue. This operator is a specialization of Multicast using a BehaviorSubject.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
source[IQbservable](#Source sequence whose elements will be multicasted through a single shared subscription.
selectorExpression, IObservable>>Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
initialValueTSourceInitial value received by observers upon subscription.

Returns: IQbservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.

See also