Files
openlayers/src/ol/Disposable.js
Frederic Junod b50a47114e Move the nullFunction to ol/functions
And rename it to `UNDEFINED`.
2018-03-01 14:41:18 +01:00

35 lines
602 B
JavaScript

/**
* @module ol/Disposable
*/
import {UNDEFINED} from './functions.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 = UNDEFINED;
export default Disposable;