Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "get-in"

Index

Functions

getIn

  • getIn<T>(state: T, path: Path0): T
  • getIn<T, A>(state: T, path: Path1<T, A>): OptPathVal<T, [A]>
  • getIn<T, A, B>(state: T, path: Path2<T, A, B>): OptPathVal<T, [A, B]>
  • getIn<T, A, B, C>(state: T, path: Path3<T, A, B, C>): OptPathVal<T, [A, B, C]>
  • getIn<T, A, B, C, D>(state: T, path: Path4<T, A, B, C, D>): OptPathVal<T, [A, B, C, D]>
  • getIn<T, A, B, C, D, E>(state: T, path: Path5<T, A, B, C, D, E>): OptPathVal<T, [A, B, C, D, E]>
  • getIn<T, A, B, C, D, E, F>(state: T, path: Path6<T, A, B, C, D, E, F>): OptPathVal<T, [A, B, C, D, E, F]>
  • getIn<T, A, B, C, D, E, F, G>(state: T, path: Path7<T, A, B, C, D, E, F, G>): OptPathVal<T, [A, B, C, D, E, F, G]>
  • getIn<T, A, B, C, D, E, F, G, H>(state: T, path: Path8<T, A, B, C, D, E, F, G, H>): OptPathVal<T, [A, B, C, D, E, F, G, H]>
  • getIn<T, A, B, C, D, E, F, G, H>(state: T, path: DeepPath<T, A, B, C, D, E, F, G, H>): any
  • Type checked, immediate use getter, i.e. same as: defGetter(path)(state).

    remarks

    Only the first 8 path levels are type checked.

    example
    // type checked path and inferred return type
    getIn({ a: { b: { c: 23 } } }, ["a","b","c"]);
    // 23

    Type parameters

    • T

    Parameters

    • state: T

      -

    • path: Path0

      -

    Returns T

  • Type parameters

    • T

    • A

    Parameters

    • state: T
    • path: Path1<T, A>

    Returns OptPathVal<T, [A]>

  • Type parameters

    • T

    • A

    • B

    Parameters

    • state: T
    • path: Path2<T, A, B>

    Returns OptPathVal<T, [A, B]>

  • Type parameters

    • T

    • A

    • B

    • C

    Parameters

    • state: T
    • path: Path3<T, A, B, C>

    Returns OptPathVal<T, [A, B, C]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    Parameters

    • state: T
    • path: Path4<T, A, B, C, D>

    Returns OptPathVal<T, [A, B, C, D]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    • E

    Parameters

    • state: T
    • path: Path5<T, A, B, C, D, E>

    Returns OptPathVal<T, [A, B, C, D, E]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    • E

    • F

    Parameters

    • state: T
    • path: Path6<T, A, B, C, D, E, F>

    Returns OptPathVal<T, [A, B, C, D, E, F]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    Parameters

    • state: T
    • path: Path7<T, A, B, C, D, E, F, G>

    Returns OptPathVal<T, [A, B, C, D, E, F, G]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    Parameters

    • state: T
    • path: Path8<T, A, B, C, D, E, F, G, H>

    Returns OptPathVal<T, [A, B, C, D, E, F, G, H]>

  • Type parameters

    • T

    • A

    • B

    • C

    • D

    • E

    • F

    • G

    • H

    Parameters

    • state: T
    • path: DeepPath<T, A, B, C, D, E, F, G, H>

    Returns any

Const getInUnsafe

  • getInUnsafe<T>(state: any, path: Path): T | undefined
  • Unchecked version of getIn. Returns undefined if path is invalid.

    remarks

    The type parameter T can be used to indicate the type of the nested value to be retrieved (default: any).

    example
    getInUnsafe({ a: { b: { c: 23 } } }, "a.b.c");
    // 23

    Type parameters

    • T

    Parameters

    • state: any

      -

    • path: Path

      -

    Returns T | undefined

Generated using TypeDoc