Class PromiseFinally
- Namespace
- MarymoorStudios.Core.Promises
- Assembly
- MarymoorStudios.Core.Promises.dll
public static class PromiseFinally
- Inheritance
-
PromiseFinally
- Inherited Members
Methods
Finally(Promise, Action, Action<Exception>)
Executes a continuation when the target resolves (success or failure).
public static Promise Finally(this Promise target, Action body, Action<Exception> error)
Parameters
target
PromiseThe trigger for execution.
body
ActionThe continuation to execute if the trigger succeeded.
error
Action<Exception>The continuation to execute if the trigger fails.
Returns
- Promise
Resolves to the outcome of the corresponding continuation.
Finally(Promise, Func<Promise>, Func<Exception, Promise>)
Executes a continuation when the target resolves (success or failure).
public static Promise Finally(this Promise target, Func<Promise> body, Func<Exception, Promise> error)
Parameters
target
PromiseThe trigger for execution.
body
Func<Promise>The continuation to execute if the trigger succeeded.
error
Func<Exception, Promise>The continuation to execute if the trigger fails.
Returns
Finally<TResult>(Promise, Func<Promise<TResult>>, Func<Exception, Promise<TResult>>)
Executes a continuation when the target resolves (success or failure).
public static Promise<TResult> Finally<TResult>(this Promise target, Func<Promise<TResult>> body, Func<Exception, Promise<TResult>> error)
Parameters
target
PromiseThe trigger for execution.
body
Func<Promise<TResult>>The continuation to execute if the trigger succeeded.
error
Func<Exception, Promise<TResult>>The continuation to execute if the trigger fails.
Returns
- Promise<TResult>
Type Parameters
TResult
Finally<T>(Promise<T>, Action<T>, Action<Exception>)
Executes a continuation when the target resolves (success or failure).
public static Promise Finally<T>(this Promise<T> target, Action<T> body, Action<Exception> error)
Parameters
target
Promise<T>The trigger for execution.
body
Action<T>The continuation to execute if the trigger succeeded.
error
Action<Exception>The continuation to execute if the trigger fails.
Returns
Type Parameters
T
Finally<T>(Promise<T>, Func<T, Promise>, Func<Exception, Promise>)
Executes a continuation when the target resolves (success or failure).
public static Promise Finally<T>(this Promise<T> target, Func<T, Promise> body, Func<Exception, Promise> error)
Parameters
target
Promise<T>The trigger for execution.
body
Func<T, Promise>The continuation to execute if the trigger succeeded.
error
Func<Exception, Promise>The continuation to execute if the trigger fails.
Returns
Type Parameters
T
Finally<T, TResult>(Promise<T>, Func<T, Promise<TResult>>, Func<Exception, Promise<TResult>>)
Executes a continuation when the target resolves (success or failure).
public static Promise<TResult> Finally<T, TResult>(this Promise<T> target, Func<T, Promise<TResult>> body, Func<Exception, Promise<TResult>> error)
Parameters
target
Promise<T>The trigger for execution.
body
Func<T, Promise<TResult>>The continuation to execute if the trigger succeeded.
error
Func<Exception, Promise<TResult>>The continuation to execute if the trigger fails.
Returns
- Promise<TResult>
Type Parameters
T
TResult
Finally<T, TResult>(Promise<T>, Func<T, TResult>, Func<Exception, TResult>)
Executes a continuation when the target resolves (success or failure).
public static Promise<TResult> Finally<T, TResult>(this Promise<T> target, Func<T, TResult> body, Func<Exception, TResult> error)
Parameters
target
Promise<T>The trigger for execution.
body
Func<T, TResult>The continuation to execute if the trigger succeeded.
error
Func<Exception, TResult>The continuation to execute if the trigger fails.
Returns
- Promise<TResult>
Type Parameters
T
TResult