Table of Contents

Class PromiseWhen

Namespace
MarymoorStudios.Core.Promises
Assembly
MarymoorStudios.Core.Promises.dll
public static class PromiseWhen
Inheritance
PromiseWhen
Inherited Members

Methods

When(Promise, Action)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise When(this Promise target, Action body)

Parameters

target Promise

The trigger for execution.

body Action

The continuation to execute if the trigger succeeded.

Returns

Promise

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

When(Promise, Func<Promise>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise When(this Promise target, Func<Promise> body)

Parameters

target Promise

The trigger for execution.

body Func<Promise>

The continuation to execute if the trigger succeeded.

Returns

Promise

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

When<TResult>(Promise, Func<Promise<TResult>>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise<TResult> When<TResult>(this Promise target, Func<Promise<TResult>> body)

Parameters

target Promise

The trigger for execution.

body Func<Promise<TResult>>

The continuation to execute if the trigger succeeded.

Returns

Promise<TResult>

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

Type Parameters

TResult

When<T>(Promise<T>, Action<T>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise When<T>(this Promise<T> target, Action<T> body)

Parameters

target Promise<T>

The trigger for execution.

body Action<T>

The continuation to execute if the trigger succeeded.

Returns

Promise

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

Type Parameters

T

When<T>(Promise<T>, Func<T, Promise>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise When<T>(this Promise<T> target, Func<T, Promise> body)

Parameters

target Promise<T>

The trigger for execution.

body Func<T, Promise>

The continuation to execute if the trigger succeeded.

Returns

Promise

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

Type Parameters

T

When<T, TResult>(Promise<T>, Func<T, Promise<TResult>>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise<TResult> When<T, TResult>(this Promise<T> target, Func<T, Promise<TResult>> body)

Parameters

target Promise<T>

The trigger for execution.

body Func<T, Promise<TResult>>

The continuation to execute if the trigger succeeded.

Returns

Promise<TResult>

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

Type Parameters

T
TResult

When<T, TResult>(Promise<T>, Func<T, TResult>)

Executes a continuation when the target resolves (with failure-coalescing).

public static Promise<TResult> When<T, TResult>(this Promise<T> target, Func<T, TResult> body)

Parameters

target Promise<T>

The trigger for execution.

body Func<T, TResult>

The continuation to execute if the trigger succeeded.

Returns

Promise<TResult>

Resolves to the outcome (either the trigger's failure, or the continuation's outcome).

Type Parameters

T
TResult