@nevware21/ts-async - v0.5.4
    Preparing search index...

    Function doFinally

    Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be simulated using then(..., ...).

    The value or promise like value to wait for

    The finally function to call once the promise has resolved or rejected

    • Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be simulated using then(..., ...).

      Type Parameters

      • T

      Parameters

      • value: T | Promise<T>

        The value or promise like value to wait for

      • finallyFn: () => void

        The finally function to call once the promise has resolved or rejected

      Returns T | Promise<T>

    • Wait for the promise to resolve or reject and then call the finallyFn. If the passed promise argument is not a promise the callback will be called synchronously with the value. If the passed promise doesn't implement finally then a finally implementation will be simulated using then(..., ...).

      Type Parameters

      • T

      Parameters

      • value: T | PromiseLike<T>

        The value or promise like value to wait for

      • finallyFn: () => void

        The finally function to call once the promise has resolved or rejected

      Returns T | PromiseLike<T>