Table of Contents

Class SingleAssignmentDisposable

Namespace
RxSharp
Assembly
RxSharp.dll

An IDisposable whose target is assigned after construction. Disposing before the target is assigned disposes that target as soon as it is set. Needed by operators (e.g. Take) that must be able to unsubscribe from a source before that source's own synchronous Subscribe call has returned — e.g. when the first emitted value already satisfies the operator.

public sealed class SingleAssignmentDisposable : IDisposable
Inheritance
System.Object
SingleAssignmentDisposable

Properties

Disposable

Gets or sets the disposable this instance wraps. Setting this before Dispose() has been called simply reassigns the wrapped target (the previous target, if any, is not disposed — see the type summary). Setting it after Dispose() has been called disposes the new value immediately instead of storing it.

public IDisposable? Disposable { get; set; }

Property Value

IDisposable?

Methods

Dispose()

Disposes the currently-wrapped Disposable, if any, and marks this instance as disposed. Safe to call more than once — subsequent calls are no-ops.

public void Dispose()