Interface UpdateAndCompactOptions<T>

interface UpdateAndCompactOptions<T> {
    onUpdate?: ((prevValue, newValue, run) => any);
    cull?(data, min, max): boolean;
    isEqual?(a, b): boolean;
}

Type Parameters

  • T

Properties

Methods

Properties

onUpdate?: ((prevValue, newValue, run) => any)

Returns an updated value. If not specified a deep merge is done.

IMPORTANT - both prevValue and newValue should be treated as frozen object and not mutated. A new value should always be returned. If you want to augment a value The deepUpdateMethod is offered

Type declaration

    • (prevValue, newValue, run): any
    • Parameters

      • prevValue: any
      • newValue: any
      • run: Run<T>

      Returns any

Methods

  • Used to determine if a entry should removed. If data is null or undefined it will also be removed. By default an empty object will not be.

    Parameters

    • data: any
    • min: number
    • max: number

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean