Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "set-in-many"

Index

Functions

setInManyUnsafe

  • setInManyUnsafe<T>(state: T, p1: Path, v1: any): T
  • setInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any): T
  • setInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any): T
  • setInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any, p4: Path, v4: any): T
  • setInManyUnsafe<T>(state: T, p1: Path, v1: any, p2: Path, v2: any, p3: Path, v3: any, p4: Path, v4: any, ...xs: any[]): T
  • Similar to setInUnsafe, but takes any number of path-value pairs as args and applies them in sequence by calling setIn() for each.

    remarks

    Any intermediate key paths missing in the data structure will be created. Does NOT mutate original (instead use mutInManyUnsafe for this purpose).

    The type parameter T can be used to indicate the type of the overall state value and will also be used as return type.

    example
    setInManyUnsafe(
      {},
      // pair #1
      "a.b", 10,
      // pair #2
      "x.y.z", 20
    );
    // { a: { b: 10 }, x: { y: { z: 20 } } }

    Type parameters

    • T

    Parameters

    • state: T

      -

    • p1: Path
    • v1: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any
    • p4: Path
    • v4: any

    Returns T

  • Type parameters

    • T

    Parameters

    • state: T
    • p1: Path
    • v1: any
    • p2: Path
    • v2: any
    • p3: Path
    • v3: any
    • p4: Path
    • v4: any
    • Rest ...xs: any[]

    Returns T

Generated using TypeDoc