waytale - v0.3.0
    Preparing search index...

    Variable mixinPropertyObserverConst

    mixinPropertyObserver: {
        update(key: string, value: any, method: string, extra?: string): void;
    } = ...

    Mixin that sepcialises the event emitter pattern to properties of the object. That is, subscribe to changes of value changes within objects.

    Type Declaration

    • update: function
      • Change the value of a property and trigger an event of the same name. A second event is triggered where the event name is the name of the property suffixed by the name of the operation.

        The event handlers will be called with the parameters of (in this order) the new value, the old value, and a reference to this.

        The method parameter specifies how the value is updated depending on whether the property is a normal value, an array, or an object. The respective value in parentheses is used as the suffix for the second trigger call.

        • assign for normal assignment (Assign)
        • prepend, append, and remove for arrays (Add, Add, Remove)
        • insert, replace, and delete for objects (Insert, Replace, Delete)

        For operations on objects, the extra parameter is used as "key" i.e. property name.

        Parameters

        • key: string

          the name of the property

        • value: any

          the new value

        • method: string

          how to update, see description

        • extra: string = undefined

          key to use for object operations

        Returns void

    mixinEventEmitter