Function getOrCall

  • Get value, but if it is a function, call it with args

    Type Parameters

    • T

    Parameters

    • s: ValOrFunc<undefined | T>

      value or function

    • ...args: any[]

      arguments to pass to function

    Returns T | undefined