ReactiveExtensions class¶
Defined in
Namespace: ReactiveUI.Extensions
Assembly: ReactiveUI.Extensions.dll
Full name: ReactiveUI.Extensions.ReactiveExtensions
Modifiers: public static
Summary¶
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¶
| Name | Summary |
|---|---|
| static WhereIsNotNull | Returns only values that are not null. Converts the nullability. |
| static AsSignal | Change the source observable type to [Unit](# This allows us to be notified when the observable emits a value. |
| static SyncTimer | Synchronized timer all instances of this with the same TimeSpan use the same timer. |
| static BufferUntil | Buffers until Start char and End char are found. |
| static BufferUntilIdle | Emit a batch when the stream goes quiet. |
| static CatchIgnore | Catch exception and return Observable.Empty. |
| static CombineLatestValuesAreAllFalse | Latest values of each sequence are all false. |
| static CombineLatestValuesAreAllTrue | Latest values of each sequence are all true. |
| static GetMax | Gets the maximum from all sources. |
| static GetMin | Gets the minimum from all sources. |
| static DetectStale | Detects when a stream becomes inactive for some period of time. |
| static Conflate | Applies a conflation algorithm to an observable stream. Anytime the stream OnNext twice below minimumUpdatePeriod, the second update gets delayed to respect the ... |
| static Heartbeat | Injects heartbeats in a stream when the source stream becomes quiet. |
| static LatestOrDefault | Emit the latest value or a default if none exists. |
| static LogErrors | Logs the errors. Inline error logging without terminating the stream. |
| static WithLimitedConcurrency | Executes with limited concurrency. |
| static OnNext | Pushes multiple values to an observer. |
| static ObserveOnSafe | If the scheduler is not null observes on that scheduler. |
| static ObserveOnIf | Conditionally switch schedulers. |
| static SkipWhileNull | Skip null values until the first non-null appears. |
| static Start | Invokes the action asynchronously surfacing the result through a Unit observable. |
| static ForEach | Flattens a sequence of enumerables into individual values. |
| static ScheduleSafe | Schedules an action immediately if scheduler null, else on scheduler. |
| static FromArray | Emits each element of an IEnumerable. |
| static Using | Using helper with Action. |
| static While | While construct. |
| static SampleLatest | Sample the latest value whenever a trigger fires. |
| static ScanWithInitial | Scan that always emits the initial value first. |
| static Schedule | Schedules a single value after a delay. |
| static Filter | Filters strings by regex. |
| static Shuffle | Randomly shuffles arrays emitted by the source. |
| static OnErrorRetry | Repeats the source until it terminates successfully (alias of Retry). |
| static TakeUntil | Takes elements until predicate returns true for an element (inclusive) then completes. |
| static SynchronizeSynchronous | Wraps values with a synchronization disposable that completes when disposed. |
| static SubscribeSynchronous | Subscribes to the specified source synchronously. |
| static SwitchIfEmpty | Provide a fallback observable if the source completes without emitting. |
| static SynchronizeAsync | Synchronizes the asynchronous operations in downstream operations. Use SubscribeSynchronus instead for a simpler version. Call Sync.Dispose() to release the lock in the... |
| static SubscribeAsync | Subscribes allowing asynchronous operations to be executed without blocking the source. |
| static Not | Emits the boolean negation of the source sequence. |
| static WhereTrue | Filters to true values only. |
| static WhereFalse | Filters to false values only. |
| static CatchAndReturn | Catches any error and returns a fallback value then completes. |
| static RetryWithBackoff | Retries with exponential backoff. |
| static RetryWithDelay | Retry with exponential. |
| static RetryForeverWithDelay | Retries the forever with delay. |
| static RetryWithFixedDelay | Retry with fixed backoff. |
| static ReplayLastOnSubscribe | Always replay the last value, even if the source hasnt produced one yet. |
| static ThrottleFirst | Emits only the first value in each time window. |
| static ThrottleUntilTrue | Throttle until a predicate becomes true. |
| static ThrottleOnScheduler | Throttles the on scheduler. |
| static ToReadOnlyBehavior | Builds a current-value subject pair: a read-only observable and the push-side observer. |
| static ToHotTask | Convert an observable to a Task that starts immediately. |
| static ToHotValueTask | Convert an observable to a ValueTask that starts immediately. Backed by a pooled... |
| static ToPropertyObservable | Convert a property getter into an observable that emits on change. |
| static ThrottleDistinct | Throttle but only emit when the value actually changes. |
| static DebounceImmediate | Debounces with an immediate first emission then standard debounce behavior. |
| static DebounceUntil | Debounce until a condition becomes true. |
| static SelectAsync | Maps values to async operations without losing ordering or cancellation semantics. |
| static SelectAsyncSequential | Projects each element to a task executed sequentially. |
| static SelectLatestAsync | Projects each element to a task but only latest result is emitted. |
| static SelectAsyncConcurrent | Projects each element to a task with limited concurrency. |
| static Pairwise | Emit (previous, current) pairs. |
| static Partition | Partitions a sequence into two based on predicate. |
| static BufferUntilInactive | Buffers items until inactivity period elapses then emits and resets buffer. |
| static WaitUntil | Emits the first element matching predicate then completes. |
| static DropIfBusy | Drop values when the previous async operation is still running. |
| static DoOnSubscribe | Executes an action at subscription time. |
| static DoOnDispose | Executes an action when subscription is disposed. |
| static WhereSelect | Fused 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 CatchReturn | Swallows any source error by emitting the fallback value followed by completion. |
| static CatchReturnUnit | Convenience overload: source.CatchReturnUnit() is shorthand for source.CatchReturn(Unit.Default). |
| static SelectConstant | Projects every source element to a stored constant, avoiding the closure allocation of .Select(_ => value). Common in fire-then-return-value chains. |
| static TrySelect | Applies 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 SelectManyThen | Chains two one-shot SelectMany projections into a single operator. Replaces .SelectMany(a).SelectMany(b) (2 operator allocations) with 1. |
| static RunAll | Runs a list of one-shot IObservable sequentially and emits a single [Default](# when all have completed.... |
| static FirstMatchFromCandidates | Walks 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... |