Type Alias CompareDataOptions<V>

CompareDataOptions<V>: {
    asPartial: boolean;
    deepEntries: boolean;
    eq: IsEqualContext<V>;
    includeMissingFromA: boolean;
    includeParents: boolean;
    pathPrefix: string;
    undefinedValueMeansRemoved: boolean;
}

Type Parameters

  • V

Type declaration

  • asPartial: boolean

    If true, it treats the B value as a partial version of B. Only the things present in B are compared. Omissions from B are not treated as removed keys.

  • deepEntries: boolean

    If true, inherited fields are also compared. This is necessary for events, for example.

    Only plain-object values are used, the other keys are ignored.

  • eq: IsEqualContext<V>

    Comparison function for values. By default uses JSON.stringify() to compare by value.

  • includeMissingFromA: boolean

    If true, includes fields that are present in B, but missing in A. False by default.

  • includeParents: boolean

    If true, emits a change under the path of a parent if its child has changed. If false (default) only changed keys are emitted.

    Eg if data is: { colour: { h:0.5, s: 0.3, l: 0.5 }} and we compare with: { colour: { h:1, s: 0.3, l: 0.5 }}

    By default only 'colour.h' is emitted. If true is set, 'colour' and 'colour.h' is emitted.

  • pathPrefix: string
  • undefinedValueMeansRemoved: boolean

    If true (default), if a value is undefined, it signals that the key itself is removed.