mapMaybePromise | WebHare Platform SDK
WebHare Platform SDK
    Preparing search index...

    Function mapMaybePromise

    • Call a function on the value of a potential promise, return the result

      Type Parameters

      • T
      • U

      Parameters

      • value: T

        Value or promise

      • cb: (arg: Awaited<T>) => U

        Callback to call on the value

      Returns U | Promise<U>

      The result of the callback, or a promise resolving to that result if the input was a promise