Files
openlayers/src/ol/Disposable.js
Tim Schaub ad62739a6e Use blocked scoped variables
In addition to using const and let, this also upgrades our linter config and removes lint (mostly whitespace).
2018-01-12 00:50:30 -07:00

35 lines
604 B
JavaScript

/**
* @module ol/Disposable
*/
import {nullFunction} from './index.js';
/**
* Objects that need to clean up after themselves.
* @constructor
*/
const Disposable = function() {};
/**
* The object has already been disposed.
* @type {boolean}
* @private
*/
Disposable.prototype.disposed_ = false;
/**
* Clean up.
*/
Disposable.prototype.dispose = function() {
if (!this.disposed_) {
this.disposed_ = true;
this.disposeInternal();
}
};
/**
* Extension point for disposable objects.
* @protected
*/
Disposable.prototype.disposeInternal = nullFunction;
export default Disposable;