Function match

  • Poor man's pattern matching in JS Use it like a switch-case that is capable of doing deep equality Unlike switch-case, it cannot assert the data type in the procedure Without a default case, the returned value is undefined

    Type Parameters

    • T

    Parameters

    • data: any

    Returns ((...cases) => Promise<T>)

      • (...cases): Promise<T>
      • Parameters

        • Rest ...cases: readonly [...Case<T>[], Proc<T>] | readonly [...Case<T>[]]

        Returns Promise<T>

Generated using TypeDoc