Skip to content

Disposable.Create(Action) method

Defined in

Type: Disposable Namespace: Minimalist.Reactive Assembly: Minimalist.Reactive.dll

Applies to

netstandard2.0

public static IDisposable Create(Action dispose)

View source

Summary: Creates a disposable object that invokes the specified action when disposed.

Parameters

NameTypeDescription
disposeActionAction to run during the first call to Dispose. The action is guaranteed to be run at most once.

Returns: IDisposable -- The disposable object that runs the given action upon disposal.

Exceptions

TypeCondition
System.ArgumentNullExceptiondispose is null.