Alchemy Logo

conditionalReturn

function conditionalReturn<T>(condition, value): Promise<undefined | T>;

Defined in: aa-sdk/core/src/utils/index.ts:152

Utility method for checking the condition and return the value if condition holds true, undefined if not.

Type Parameter

T

ParameterTypeDescription

condition

Promise<boolean>

condition to check

value

() => Promise<T>

value to return when condition holds true

Promise<undefined | T>

the value if condition holds true, undefined if not

Was this page helpful?