{"size": 688, "ext": "js", "max_stars_repo_path": "src/renderer/renderer/tools/datachangelistener.js", "max_stars_repo_name": "CCLDESTY/xml3d.js", "max_stars_repo_stars_event_min_datetime": "2015-01-13T08:44:36.000Z", "max_stars_repo_stars_event_max_datetime": "2020-11-16T15:38:22.000Z", "max_issues_repo_path": "src/renderer/renderer/tools/datachangelistener.js", "max_issues_repo_name": "CCLDESTY/xml3d.js", "max_issues_repo_issues_event_min_datetime": "2015-01-06T10:55:22.000Z", "max_issues_repo_issues_event_max_datetime": "2019-08-02T10:21:33.000Z", "max_forks_repo_path": "src/renderer/renderer/tools/datachangelistener.js", "max_forks_repo_name": "CCLDESTY/xml3d.js", "max_forks_repo_forks_event_min_datetime": "2015-03-09T06:14:23.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-03T12:07:46.000Z"}
{"max_stars_count": 52, "max_issues_count": 142, "max_forks_count": 16, "avg_line_length": 26.4615384615, "max_line_length": 88, "alphanum_fraction": 0.6875}
var DataChangeNotifier = require("../../../xflow/interface/data.js").DataChangeNotifier;

/**
 *
 * @constructor
 */
var DataChangeListener = function () {
    DataChangeNotifier.addListener(this.dataEntryChanged);
};

/**
 *
 * @param {Xflow.DataEntry} entry
 * @param {Xflow.DATA_ENTRY_STATE} notification
 */
DataChangeListener.prototype.dataEntryChanged = function (entry, notification) {
    if (entry.userData.webglData) {
        for (var i in entry.userData.webglData) {
            var oldChanged = entry.userData.webglData[i].changed;
            entry.userData.webglData[i].changed = Math.max(oldChanged, notification);
        }
    }
};

module.exports = DataChangeListener;
