Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "rfn/auto-obj"

Index

Functions

Functions

autoObj

  • autoObj<T>(prefix: string): Reducer<IObjectOf<T>, T>
  • autoObj<T>(prefix: string, xs: Iterable<T>): IObjectOf<T>
  • Reducer accepting values of any type and assigning them to auto-labeled keys in an object. Keys consist of given prefix and monotonically increasing ID.

    example
    autoObj("id", ["foo", "bar", "baz"])
    // { id0: "foo", id1: "bar", id2: "baz" }

    Type parameters

    • T

    Parameters

    • prefix: string

      shared prefix

    Returns Reducer<IObjectOf<T>, T>

  • Type parameters

    • T

    Parameters

    • prefix: string
    • xs: Iterable<T>

    Returns IObjectOf<T>

Generated using TypeDoc