@turbox3d/command-manager
Version:
Large-scale productivity application command management library
28 lines • 1.4 kB
JavaScript
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
import { CommandManager } from './CommandManager';
/**
* 构建一个 CommandManager 基类
*/
function manager(declaredMap) {
return /*#__PURE__*/function (_CommandManager) {
function _class() {
var _this;
_classCallCheck(this, _class);
_this = _callSuper(this, _class);
Object.keys(declaredMap).forEach(function (key) {
var command = new declaredMap[key](_this);
_this[key] = command;
});
return _this;
}
_inherits(_class, _CommandManager);
return _createClass(_class);
}(CommandManager);
}
export { manager };