Upserter<T>: ((previous) => T)

A function that takes a previous value of type T (or undefined if not present) and returns an upserted value of the same type. Used for inserting or updating values in certain data structures or scenarios.

Type Parameters

  • T

    The type of the value being upserted.

Type declaration

    • (previous): T
    • Parameters

      • previous: T | undefined

        The previous value to be upserted or undefined if not present.

      Returns T

Returns

  • The upserted value.