UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

29 lines 1.9 kB
import _classCallCheck from "@babel/runtime/helpers/classCallCheck"; import _createClass from "@babel/runtime/helpers/createClass"; import _get from "@babel/runtime/helpers/get"; import _inherits from "@babel/runtime/helpers/inherits"; import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn"; import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf"; function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } import { EventEmitter } from 'events'; export var AnnotationUpdateEmitter = /*#__PURE__*/function (_EventEmitter) { _inherits(AnnotationUpdateEmitter, _EventEmitter); var _super = _createSuper(AnnotationUpdateEmitter); function AnnotationUpdateEmitter() { _classCallCheck(this, AnnotationUpdateEmitter); return _super.apply(this, arguments); } _createClass(AnnotationUpdateEmitter, [{ key: "on", value: function on(event, listener) { return _get(_getPrototypeOf(AnnotationUpdateEmitter.prototype), "on", this).call(this, event, listener); } }, { key: "off", value: function off(event, listener) { return _get(_getPrototypeOf(AnnotationUpdateEmitter.prototype), "removeListener", this).call(this, event, listener); } }]); return AnnotationUpdateEmitter; }(EventEmitter);