@chix/flow
Version:
45 lines • 1.69 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../util");
function $Action(Base) {
return (function (_super) {
__extends(Action$, _super);
function Action$() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.actionName = '';
return _this;
}
Action$.prototype.action = function (action) {
if (!this.actions.hasOwnProperty(action)) {
throw Error('this.action should return something with the action map.');
}
return this.actions[action];
};
Action$.prototype.isAction = function () {
return Boolean(this.actionName);
};
Action$.prototype.use = function (_action) { };
return Action$;
}(Base));
}
exports.$Action = $Action;
(function ($Action) {
function create(Base) {
return util_1.mixin($Action)(Base);
}
$Action.create = create;
})($Action = exports.$Action || (exports.$Action = {}));
//# sourceMappingURL=action.js.map