PropertyChanged

Provides the interface for monitoring for property value changes.

Method Summary

Public Methods

connect(callback: function(message: string))

This method watches for a property value change and runs a callback when that occurs.

disconnect(callback: function(message: string))

This method removes a callback set with the connect() method.

Public Methods

public connect(callback: function(message: string)) source

This method watches for a property value change and runs a callback when that occurs.

Params:

NameTypeAttributeDescription
callback function(message: string)

the callback function

Example:

function ringerVolumeChanged() {
    console.log("Ringer volume changed to : " + dapi.configuration.parameter(name).value);
}
// Connect for value change
dapi.configuration.parameter("Preferences.RingerVolume").valueChanged.connect(ringerVolumeChanged);

public disconnect(callback: function(message: string)) source

This method removes a callback set with the connect() method.

Params:

NameTypeAttributeDescription
callback function(message: string)

the callback function

Example:

// disconnect the callback
dapi.configuration.parameter("Preferences.RingerVolume").valueChanged.disconnect(ringerVolumeChanged);