"use strict";

exports.__esModule = true;
exports.spawnerMiddleware = exports.default = void 0;
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var spawners = {};
var spawnerMiddleware = exports.spawnerMiddleware = function spawnerMiddleware(store) {
  return function (next) {
    return function (action) {
      var actionSpawner = spawners[action.type];
      if (actionSpawner) {
        var spawn = actionSpawner(action);
        if (spawn) {
          next(spawn);
        }
      }
      return next(action);
    };
  };
};
var addSpawner = function addSpawner(type, mapper) {
  if (spawners[type]) {
    throw new Error("Action spawner for type " + type + " was attempted overwritten.");
  }
  spawners[type] = mapper;
};
var _default = addSpawner;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(spawners, "spawners", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(spawnerMiddleware, "spawnerMiddleware", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(addSpawner, "addSpawner", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(spawners, "spawners", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(spawnerMiddleware, "spawnerMiddleware", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(addSpawner, "addSpawner", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/spawnerMiddleware.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();