Table of Contents

Class SubscribeWhen

Namespace
Bonsai.Reactive
Assembly
Bonsai.Core.dll

Represents an operator that subscribes to the first sequence only after the second sequence emits a notification.

Marble diagram

The SubscribeWhen operator modifies the source sequence by waiting for the first value emitted by the second sequence before subscribing to the first sequence. This has the effect of delaying the start of the sequence until the second sequence emits a value.

SubscribeWhen can be used to control the timing of initialization. Note that if a source is hot, delaying the start of the sequence will not preserve past data.

[Combinator]
public class SubscribeWhen
Inheritance
SubscribeWhen
Inherited Members

Methods

Process<TSource, TOther>(IObservable<TSource>, IObservable<TOther>)

Subscribes to an observable sequence only after the second sequence produces an element.

public IObservable<TSource> Process<TSource, TOther>(IObservable<TSource> source, IObservable<TOther> other)

Parameters

source IObservable<TSource>

The sequence to subscribe to.

other IObservable<TOther>

The observable sequence indicating when to subscribe to the source sequence.

Returns

IObservable<TSource>

An observable sequence that is identical to the source sequence but where subscription is delayed until the other sequence emits a notification.

Type Parameters

TSource

The type of the elements in the source sequence.

TOther

The type of the elements in the other sequence.