import Eventable from 'core/Event';

class Handler {
    constructor(target) {
        this.target = target;
    }

    /**
     * Enables the handler
     * @return {Handler} this
     */
    enable() {
        if (this._enabled) {
            return this;
        }
        this._enabled = true;
        this.addHooks();
        return this;
    }

    /**
     * Disablesthe handler
     * @return {Handler} this
     */
    disable() {
        if (!this._enabled) {
            return this;
        }
        this._enabled = false;
        this.removeHooks();
        return this;
    }

    /**
     * Returns true if the handler is enabled.
     * @return {Boolean}
     */
    enabled() {
        return !!this._enabled;
    }

    remove() {
        this.disable();
        delete this.target;
        delete this.dom;
    }
}

/**
 * Base class for all the interaction handlers
 * @class
 * @category handler
 * @extends Class
 * @mixins Eventable
 * @abstract
 * @protected
 */
export default class extends Eventable(Handler) {


}

@@ -34,21 +34,214 @@
 ';%0A%0A
-class Handler
+/**%0A * Base class for all the interaction handlers%0A * @class%0A * @category handler%0A * @extends Class%0A * @mixins Eventable%0A * @abstract%0A * @protected%0A */%0Aexport default class Handler extends Eventable(Object)
  %7B%0A 
@@ -261,24 +261,41 @@
 r(target) %7B%0A
+        super();%0A
         this
@@ -1042,211 +1042,4 @@
 %7D%0A%7D%0A
-%0A/**%0A * Base class for all the interaction handlers%0A * @class%0A * @category handler%0A * @extends Class%0A * @mixins Eventable%0A * @abstract%0A * @protected%0A */%0Aexport default class extends Eventable(Handler) %7B%0A%0A%0A%7D%0A

improve Handler's implementation