{"size": 1107, "ext": "js", "max_stars_repo_path": "src/Disposable.js", "max_stars_repo_name": "igorski/zjslib", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/Disposable.js", "max_issues_repo_name": "igorski/zjslib", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Disposable.js", "max_forks_repo_name": "igorski/zjslib", "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": 21.2884615385, "max_line_length": 71, "alphanum_fraction": 0.7009936766}
module.exports = Disposable;

/**
 * a Disposable Object has an interface to clean up its
 * used resources by invoking the "dispose"-function prior
 * to destroying the object. The "disposeInternal"-method can
 * be overridden in your custom Disposable-extending Objects
 *
 * @see {goog.Disposable} (Google Closure library)
 * @constructor
 */
function Disposable()
{

}

/* class properties */

/** @private @type {boolean} */ Disposable.prototype._disposed = false;

/* public methods */

/**
 * method that will invoke the internal disposal method
 * which can be used to remove listeners, referenced Objects, etc.
 * this method is not meant to be overridden
 *
 * @public
 */
Disposable.prototype.dispose = function()
{
    if ( this._disposed ) {
        return;
    }
    this.disposeInternal();
    this._disposed = true;
};

/* protected methods */

/**
 * internal disposal method
 * override to clean up listeners, recursively call
 * disposal of referenced Disposable objects, etc.
 *
 * @protected
 */
Disposable.prototype.disposeInternal = function()
{
    // override in derived classes
};
