Function withChoices

  • Carries out a callback during which a set of choices will be handled as supplied

    Type Parameters

    • T

    Parameters

    • choices: {
          [choice: number]: number | string;
      }

      Choices to set during callback

      • [choice: number]: number | string
    • callback: (() => T)

      Callback to execute with set choices

        • (): T
        • Returns T

    Returns T

    Return value of the supplied callback