Function asTuple

  • Takes one or more decoders and produces a decoder for a Tuple of elements decoder provided.

    Example

    asTuple(asConst("archived")) // Decoder<["archived"]>
    asTuple(asString, asInt) // Decoder<[string, int]>
    asTuple(asString, asInt, asBoolean) // Decoder<[string, int, boolean]>

    Type Parameters

    Parameters

    • firstItemDecoder: Decoder<T1>

      A decoder for the first tuple item

    • Rest ...decs: TupleItemDecoders<TN>

      A variable number of decoders for the other tuple items

    Returns TupleDecoder<[T1, ...TN]>

    A decoder for a Tuple of [T1, ...TN]

Generated using TypeDoc