Function wrap

  • Wrap the calling of a function into async/await (promise) context

    • intended to be similar to bluebird.try

    Type Parameters

    • T
    • F extends ((...args) => T)

    Parameters

    • func: F

      function to wrap in async context

    • Rest ...args2: Parameters<F>

    Returns Promise<T>

    result from func