Function watchField

  • A decorator for a public field which sets calls a callback if the property's value is changed.

    Type Parameters

    • V

      The type of the field being watched

    Parameters

    • callback: ((oldValue: V) => void)

      The callback to call if the value changes. this is bound.

        • (oldValue): void
        • Parameters

          • oldValue: V

          Returns void

    Returns PropertyDecorator