Axinom Mosaic Libraries
    Preparing search index...

    Function getArrayDiff

    • Compares two arrays and returns an object holding an array for the added and another one for the removed items.

      Type Parameters

      • T

      Parameters

      • current: T[] | null | undefined

        The array of values after the changes were performed

      • initial: T[] | null | undefined

        The array of values before the changes were performed

      Returns { added: T[]; removed: T[] }

      • added: T[]

        The items that were added

      • removed: T[]

        The items that were removed

    • Compares two arrays and returns an object holding an array for the added and another one for the removed items.

      Type Parameters

      • T

      Parameters

      • current: T[] | null | undefined

        The array of values after the changes were performed

      • initial: T[] | null | undefined

        The array of values before the changes were performed

      • Optionalkey: keyof T

        The name of the property that will be used to identify objects to compare them for updates

      Returns { added: T[]; removed: T[]; updated: T[] }

      • added: T[]

        The items that were added

      • removed: T[]

        The items that were removed

      • updated: T[]

        The items that were updated