Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

Accessor

Accessor: function | KeyPath

Key

Key: string | number | symbol

KeyPath

KeyPath: Key[]

Functions

getIn

  • getIn<T, V>(record: T, accessor: Accessor<T, V>, ctx?: KeyPath): V | void
  • get a deep child

    Type parameters

    • T

    • V

    Parameters

    • record: T

      The object to update, it can be a plain object or a class instance

    • accessor: Accessor<T, V>

      A lambda function to get the key path, support dot, [''], [""], [1], do not support dynamic variable, function call, e.g.

    • Optional ctx: KeyPath

      Dynamic key map.

    Returns V | void

setCacheSize

  • setCacheSize(maxSize?: number): void
  • Parameters

    • Default value maxSize: number = 50

    Returns void

setIn

  • Set a deep child

    Type parameters

    • T

    • V

    Parameters

    • record: T

      The object to update, it can be a plain object or a class instance

    • accessor: Accessor<T, V>

      A lambda function to get the key path, support dot, [''], [""], [1], do not support dynamic variable, function call, e.g.

    • Optional value: V

      The new value to set, if it is ignored it will be set to undefined.

    • Optional ctx: KeyPath

      Dynamic key map.

    Returns T

unsetIn

  • unsetIn<T, V>(record: T, accessor: Accessor<T, V | void>, ctx?: KeyPath): T
  • Unset a deep child

    Type parameters

    • T

    • V

    Parameters

    • record: T

      The object to update, it can be a plain object or a class instance

    • accessor: Accessor<T, V | void>

      A lambda function to get the key path, support dot, [''], [""], [1], do not support dynamic variable, function call, e.g.

    • Optional ctx: KeyPath

      Dynamic key map.

    Returns T

updateIn

  • updateIn<T, V, A>(record: T, accessor: Accessor<T, V>, updator?: undefined | function, ctx?: KeyPath): T
  • Update a deep child by old value

    Type parameters

    • T

    • V

    • A

    Parameters

    • record: T

      The object to update, it can be a plain object or a class instance

    • accessor: Accessor<T, V>

      A lambda function to get the key path, support dot, [''], [""], [1], do not support dynamic variable, function call, e.g.

    • Optional updator: undefined | function

      A update function that take the old value and return the new value.

    • Optional ctx: KeyPath

      Dynamic key map.

    Returns T

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc