typed-action.js 581 B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  6. var typedAction = exports.typedAction = function typedAction(type, fn) {
  7. var result = function result() {
  8. return _extends({}, fn.apply(undefined, arguments), { type: type });
  9. };
  10. result.TYPE = type;
  11. return result;
  12. };