ezyVet Javascript Helper Library Documentation
    Preparing search index...

    Function setValueInChildArray

    • Sets a key in all objects in an array property of the values object passed.

      Useful for setting all lines in the formik state in components that do not have access to the financial table state. (headers, etc). Performs a similar role to updateAvailableLines but not limited to operating on LineState objects.

      Type Parameters

      • T extends object

      Parameters

      • values: T

        The object to update the value in.

      • recursionKey: string

        The the key to recurse down to find child objects.

      • newValue: any

        The value to set all keys in the values object to.

      • keyToSet: string

        The key to set newValue to.

      Returns T

      array of strings