{"size": 937, "ext": "js", "max_stars_repo_path": "public/js/src/hc-backend/dgrid/_Refresher.js", "max_stars_repo_name": "huskycmf/hc-backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "public/js/src/hc-backend/dgrid/_Refresher.js", "max_issues_repo_name": "huskycmf/hc-backend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/js/src/hc-backend/dgrid/_Refresher.js", "max_forks_repo_name": "huskycmf/hc-backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.5588235294, "max_line_length": 82, "alphanum_fraction": 0.4290288154}
define([
    "dojo/_base/declare",
    "dojo/_base/lang"
], function(declare, lang) {
    // module:
    //     hc-backend/dgrid/_Refresher

    return declare(null, {
        //  summary:
        //      Mixin to implement safe refresh method for the grid
        refresh: function () {
            try {
                if (this.__lock) {
                    console.log("REFRESH CAUGHT BY LOCK");
                    return;
                }
                this.__lock = true;
                var def = this.inherited(arguments);

                if (def && def.then) {
                    def.then(lang.hitch(this, function (){this.__lock = false;}));
                } else {
                    this.__lock = false;
                }

                console.log("REFRESHED");
            } catch (e) {
                console.error(this.declaredClass, arguments, e);
                throw e;
            }
        }
    });
});
