@freshlysqueezedgames/hermes
Version:
independant state management pipeline
32 lines (23 loc) • 967 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var toString = Object.prototype.toString;
var Action = function Action(name) {
var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object.create(null);
var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Object.create(null);
var apply = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
_classCallCheck(this, Action);
var t = this;
if (!name || typeof name !== 'string') {
throw new Error('the first parameter must be a string identifier');
}
t.name = name;
t.payload = payload;
t.context = context;
t.apply = apply;
};
Action.DEFAULT = 'action.default';
exports.default = Action;
//# sourceMappingURL=Action.js.map