Skip to main content

Diff <N, V>

One change to one field of one node.

Diffs are the currency of Octo: comparing the graph you just described against the last committed one produces a list of them, and every action is selected and driven by the diffs it accepts.

@group

Functions/Diff

Index

Constructors

constructor

  • Diff<N, V>(node: N, action: DiffAction, field: string, value: V, reason?: string): Diff<N, V>
  • Type parameters

    • N: UnknownNode = UnknownNode
    • V = unknown

    Parameters

    • node: N

      The node that changed.

    • action: DiffAction

      What happened to it.

    • field: string

      The field of the node that changed.

    • value: V

      The new value of the field.

    • optionalreason: string

      Why the change is being made, carried into reports.

    Returns Diff<N, V>

Properties

readonlyaction

action: DiffAction

What happened.

readonlyfield

field: string

The field of the node that changed, e.g. resourceId, properties, or parent.

readonlynode

node: N

The node that changed.

optionalreadonlyreason

reason?: string

Why the change is being made, when the field alone does not explain it. It is carried into reports, so write it for whoever reads the plan.

readonlyvalue

value: V

The new value of the field. Its shape depends on the field.