Skip to content

ReactiveExtensions class

Defined in

Namespace: ReactiveUI.Extensions Assembly: ReactiveUI.Extensions.dll Full name: ReactiveUI.Extensions.ReactiveExtensions Modifiers: public static

Summary

View source

        Extension methods for Reactive objects.
        

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Methods

NameSummary
static WhereIsNotNullReturns only values that are not null. Converts the nullability.
static AsSignalChange the source observable type to [Unit](# This allows us to be notified when the observable emits a value.
static SyncTimerSynchronized timer all instances of this with the same TimeSpan use the same timer.
static BufferUntilBuffers until Start char and End char are found.
static BufferUntilIdleEmit a batch when the stream goes quiet.
static CatchIgnoreCatch exception and return Observable.Empty.
static CombineLatestValuesAreAllFalseLatest values of each sequence are all false.
static CombineLatestValuesAreAllTrueLatest values of each sequence are all true.
static GetMaxGets the maximum from all sources.
static GetMinGets the minimum from all sources.
static DetectStaleDetects when a stream becomes inactive for some period of time.
static ConflateApplies a conflation algorithm to an observable stream. Anytime the stream OnNext twice below minimumUpdatePeriod, the second update gets delayed to respect the ...
static HeartbeatInjects heartbeats in a stream when the source stream becomes quiet.
static LatestOrDefaultEmit the latest value or a default if none exists.
static LogErrorsLogs the errors. Inline error logging without terminating the stream.
static WithLimitedConcurrencyExecutes with limited concurrency.
static OnNextPushes multiple values to an observer.
static ObserveOnSafeIf the scheduler is not null observes on that scheduler.
static ObserveOnIfConditionally switch schedulers.
static SkipWhileNullSkip null values until the first non-null appears.
static StartInvokes the action asynchronously surfacing the result through a Unit observable.
static ForEachFlattens a sequence of enumerables into individual values.
static ScheduleSafeSchedules an action immediately if scheduler null, else on scheduler.
static FromArrayEmits each element of an IEnumerable.
static UsingUsing helper with Action.
static WhileWhile construct.
static SampleLatestSample the latest value whenever a trigger fires.
static ScanWithInitialScan that always emits the initial value first.
static ScheduleSchedules a single value after a delay.
static FilterFilters strings by regex.
static ShuffleRandomly shuffles arrays emitted by the source.
static OnErrorRetryRepeats the source until it terminates successfully (alias of Retry).
static TakeUntilTakes elements until predicate returns true for an element (inclusive) then completes.
static SynchronizeSynchronousWraps values with a synchronization disposable that completes when disposed.
static SubscribeSynchronousSubscribes to the specified source synchronously.
static SwitchIfEmptyProvide a fallback observable if the source completes without emitting.
static SynchronizeAsyncSynchronizes the asynchronous operations in downstream operations. Use SubscribeSynchronus instead for a simpler version. Call Sync.Dispose() to release the lock in the...
static SubscribeAsyncSubscribes allowing asynchronous operations to be executed without blocking the source.
static NotEmits the boolean negation of the source sequence.
static WhereTrueFilters to true values only.
static WhereFalseFilters to false values only.
static CatchAndReturnCatches any error and returns a fallback value then completes.
static RetryWithBackoffRetries with exponential backoff.
static RetryWithDelayRetry with exponential.
static RetryForeverWithDelayRetries the forever with delay.
static RetryWithFixedDelayRetry with fixed backoff.
static ReplayLastOnSubscribeAlways replay the last value, even if the source hasn’t produced one yet.
static ThrottleFirstEmits only the first value in each time window.
static ThrottleUntilTrueThrottle until a predicate becomes true.
static ThrottleOnSchedulerThrottles the on scheduler.
static ToReadOnlyBehaviorBuilds a current-value subject pair: a read-only observable and the push-side observer.
static ToHotTaskConvert an observable to a Task that starts immediately.
static ToHotValueTaskConvert an observable to a ValueTask that starts immediately. Backed by a pooled...
static ToPropertyObservableConvert a property getter into an observable that emits on change.
static ThrottleDistinctThrottle but only emit when the value actually changes.
static DebounceImmediateDebounces with an immediate first emission then standard debounce behavior.
static DebounceUntilDebounce until a condition becomes true.
static SelectAsyncMaps values to async operations without losing ordering or cancellation semantics.
static SelectAsyncSequentialProjects each element to a task executed sequentially.
static SelectLatestAsyncProjects each element to a task but only latest result is emitted.
static SelectAsyncConcurrentProjects each element to a task with limited concurrency.
static PairwiseEmit (previous, current) pairs.
static PartitionPartitions a sequence into two based on predicate.
static BufferUntilInactiveBuffers items until inactivity period elapses then emits and resets buffer.
static WaitUntilEmits the first element matching predicate then completes.
static DropIfBusyDrop values when the previous async operation is still running.
static DoOnSubscribeExecutes an action at subscription time.
static DoOnDisposeExecutes an action when subscription is disposed.
static WhereSelectFused Where(predicate).Select(selector). Allocates a single observer per subscription instead of two, eliminating the intermediate operator that the equivalent Rx chain would build.
static CatchReturnSwallows any source error by emitting the fallback value followed by completion.
static CatchReturnUnitConvenience overload: source.CatchReturnUnit() is shorthand for source.CatchReturn(Unit.Default).
static SelectConstantProjects every source element to a stored constant, avoiding the closure allocation of .Select(_ => value). Common in fire-then-return-value chains.
static TrySelectApplies selector and emits only non-null results. Replaces .Select(f).Where(x => x is not null).Select(x => x!) with a single operator allocation.
static SelectManyThenChains two one-shot SelectMany projections into a single operator. Replaces .SelectMany(a).SelectMany(b) (2 operator allocations) with 1.
static RunAllRuns a list of one-shot IObservable sequentially and emits a single [Default](# when all have completed....
static FirstMatchFromCandidatesWalks a list of candidate keys sequentially, projects each into a one-shot observable, transforms the raw value, and emits the first transformed value that satisfies predicate. Errors from...
Inherited members