[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/js/dist/ -> redux-routine.js (source)

   1  this["wp"] = this["wp"] || {}; this["wp"]["reduxRoutine"] =
   2  /******/ (function(modules) { // webpackBootstrap
   3  /******/     // The module cache
   4  /******/     var installedModules = {};
   5  /******/
   6  /******/     // The require function
   7  /******/ 	function __webpack_require__(moduleId) {
   8  /******/
   9  /******/         // Check if module is in cache
  10  /******/         if(installedModules[moduleId]) {
  11  /******/             return installedModules[moduleId].exports;
  12  /******/         }
  13  /******/         // Create a new module (and put it into the cache)
  14  /******/         var module = installedModules[moduleId] = {
  15  /******/             i: moduleId,
  16  /******/             l: false,
  17  /******/             exports: {}
  18  /******/         };
  19  /******/
  20  /******/         // Execute the module function
  21  /******/         modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  22  /******/
  23  /******/         // Flag the module as loaded
  24  /******/         module.l = true;
  25  /******/
  26  /******/         // Return the exports of the module
  27  /******/         return module.exports;
  28  /******/     }
  29  /******/
  30  /******/
  31  /******/     // expose the modules object (__webpack_modules__)
  32  /******/     __webpack_require__.m = modules;
  33  /******/
  34  /******/     // expose the module cache
  35  /******/     __webpack_require__.c = installedModules;
  36  /******/
  37  /******/     // define getter function for harmony exports
  38  /******/     __webpack_require__.d = function(exports, name, getter) {
  39  /******/         if(!__webpack_require__.o(exports, name)) {
  40  /******/             Object.defineProperty(exports, name, { enumerable: true, get: getter });
  41  /******/         }
  42  /******/     };
  43  /******/
  44  /******/     // define __esModule on exports
  45  /******/     __webpack_require__.r = function(exports) {
  46  /******/         if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  47  /******/             Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  48  /******/         }
  49  /******/         Object.defineProperty(exports, '__esModule', { value: true });
  50  /******/     };
  51  /******/
  52  /******/     // create a fake namespace object
  53  /******/     // mode & 1: value is a module id, require it
  54  /******/     // mode & 2: merge all properties of value into the ns
  55  /******/     // mode & 4: return value when already ns object
  56  /******/     // mode & 8|1: behave like require
  57  /******/     __webpack_require__.t = function(value, mode) {
  58  /******/         if(mode & 1) value = __webpack_require__(value);
  59  /******/         if(mode & 8) return value;
  60  /******/         if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  61  /******/         var ns = Object.create(null);
  62  /******/         __webpack_require__.r(ns);
  63  /******/         Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  64  /******/         if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  65  /******/         return ns;
  66  /******/     };
  67  /******/
  68  /******/     // getDefaultExport function for compatibility with non-harmony modules
  69  /******/     __webpack_require__.n = function(module) {
  70  /******/         var getter = module && module.__esModule ?
  71  /******/ 			function getDefault() { return module['default']; } :
  72  /******/ 			function getModuleExports() { return module; };
  73  /******/         __webpack_require__.d(getter, 'a', getter);
  74  /******/         return getter;
  75  /******/     };
  76  /******/
  77  /******/     // Object.prototype.hasOwnProperty.call
  78  /******/     __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  79  /******/
  80  /******/     // __webpack_public_path__
  81  /******/     __webpack_require__.p = "";
  82  /******/
  83  /******/
  84  /******/     // Load entry module and return exports
  85  /******/     return __webpack_require__(__webpack_require__.s = 484);
  86  /******/ })
  87  /************************************************************************/
  88  /******/ ({
  89  
  90  /***/ 153:
  91  /***/ (function(module, exports) {
  92  
  93  module.exports = isPromise;
  94  module.exports.default = isPromise;
  95  
  96  function isPromise(obj) {
  97    return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  98  }
  99  
 100  
 101  /***/ }),
 102  
 103  /***/ 166:
 104  /***/ (function(module, exports, __webpack_require__) {
 105  
 106  "use strict";
 107  
 108  
 109  Object.defineProperty(exports, "__esModule", {
 110    value: true
 111  });
 112  
 113  var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
 114  
 115  var _keys = __webpack_require__(274);
 116  
 117  var _keys2 = _interopRequireDefault(_keys);
 118  
 119  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 120  
 121  var is = {
 122    obj: function obj(value) {
 123      return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
 124    },
 125    all: function all(value) {
 126      return is.obj(value) && value.type === _keys2.default.all;
 127    },
 128    error: function error(value) {
 129      return is.obj(value) && value.type === _keys2.default.error;
 130    },
 131    array: Array.isArray,
 132    func: function func(value) {
 133      return typeof value === 'function';
 134    },
 135    promise: function promise(value) {
 136      return value && is.func(value.then);
 137    },
 138    iterator: function iterator(value) {
 139      return value && is.func(value.next) && is.func(value.throw);
 140    },
 141    fork: function fork(value) {
 142      return is.obj(value) && value.type === _keys2.default.fork;
 143    },
 144    join: function join(value) {
 145      return is.obj(value) && value.type === _keys2.default.join;
 146    },
 147    race: function race(value) {
 148      return is.obj(value) && value.type === _keys2.default.race;
 149    },
 150    call: function call(value) {
 151      return is.obj(value) && value.type === _keys2.default.call;
 152    },
 153    cps: function cps(value) {
 154      return is.obj(value) && value.type === _keys2.default.cps;
 155    },
 156    subscribe: function subscribe(value) {
 157      return is.obj(value) && value.type === _keys2.default.subscribe;
 158    },
 159    channel: function channel(value) {
 160      return is.obj(value) && is.func(value.subscribe);
 161    }
 162  };
 163  
 164  exports.default = is;
 165  
 166  /***/ }),
 167  
 168  /***/ 2:
 169  /***/ (function(module, exports) {
 170  
 171  (function() { module.exports = window["lodash"]; }());
 172  
 173  /***/ }),
 174  
 175  /***/ 273:
 176  /***/ (function(module, exports, __webpack_require__) {
 177  
 178  "use strict";
 179  
 180  
 181  Object.defineProperty(exports, "__esModule", {
 182    value: true
 183  });
 184  exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
 185  
 186  var _keys = __webpack_require__(274);
 187  
 188  var _keys2 = _interopRequireDefault(_keys);
 189  
 190  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 191  
 192  var all = exports.all = function all(value) {
 193    return {
 194      type: _keys2.default.all,
 195      value: value
 196    };
 197  };
 198  
 199  var error = exports.error = function error(err) {
 200    return {
 201      type: _keys2.default.error,
 202      error: err
 203    };
 204  };
 205  
 206  var fork = exports.fork = function fork(iterator) {
 207    for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
 208      args[_key - 1] = arguments[_key];
 209    }
 210  
 211    return {
 212      type: _keys2.default.fork,
 213      iterator: iterator,
 214      args: args
 215    };
 216  };
 217  
 218  var join = exports.join = function join(task) {
 219    return {
 220      type: _keys2.default.join,
 221      task: task
 222    };
 223  };
 224  
 225  var race = exports.race = function race(competitors) {
 226    return {
 227      type: _keys2.default.race,
 228      competitors: competitors
 229    };
 230  };
 231  
 232  var delay = exports.delay = function delay(timeout) {
 233    return new Promise(function (resolve) {
 234      setTimeout(function () {
 235        return resolve(true);
 236      }, timeout);
 237    });
 238  };
 239  
 240  var invoke = exports.invoke = function invoke(func) {
 241    for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
 242      args[_key2 - 1] = arguments[_key2];
 243    }
 244  
 245    return {
 246      type: _keys2.default.call,
 247      func: func,
 248      context: null,
 249      args: args
 250    };
 251  };
 252  
 253  var call = exports.call = function call(func, context) {
 254    for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
 255      args[_key3 - 2] = arguments[_key3];
 256    }
 257  
 258    return {
 259      type: _keys2.default.call,
 260      func: func,
 261      context: context,
 262      args: args
 263    };
 264  };
 265  
 266  var apply = exports.apply = function apply(func, context, args) {
 267    return {
 268      type: _keys2.default.call,
 269      func: func,
 270      context: context,
 271      args: args
 272    };
 273  };
 274  
 275  var cps = exports.cps = function cps(func) {
 276    for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
 277      args[_key4 - 1] = arguments[_key4];
 278    }
 279  
 280    return {
 281      type: _keys2.default.cps,
 282      func: func,
 283      args: args
 284    };
 285  };
 286  
 287  var subscribe = exports.subscribe = function subscribe(channel) {
 288    return {
 289      type: _keys2.default.subscribe,
 290      channel: channel
 291    };
 292  };
 293  
 294  var createChannel = exports.createChannel = function createChannel(callback) {
 295    var listeners = [];
 296    var subscribe = function subscribe(l) {
 297      listeners.push(l);
 298      return function () {
 299        return listeners.splice(listeners.indexOf(l), 1);
 300      };
 301    };
 302    var next = function next(val) {
 303      return listeners.forEach(function (l) {
 304        return l(val);
 305      });
 306    };
 307    callback(next);
 308  
 309    return {
 310      subscribe: subscribe
 311    };
 312  };
 313  
 314  /***/ }),
 315  
 316  /***/ 274:
 317  /***/ (function(module, exports, __webpack_require__) {
 318  
 319  "use strict";
 320  
 321  
 322  Object.defineProperty(exports, "__esModule", {
 323    value: true
 324  });
 325  var keys = {
 326    all: Symbol('all'),
 327    error: Symbol('error'),
 328    fork: Symbol('fork'),
 329    join: Symbol('join'),
 330    race: Symbol('race'),
 331    call: Symbol('call'),
 332    cps: Symbol('cps'),
 333    subscribe: Symbol('subscribe')
 334  };
 335  
 336  exports.default = keys;
 337  
 338  /***/ }),
 339  
 340  /***/ 294:
 341  /***/ (function(module, exports, __webpack_require__) {
 342  
 343  "use strict";
 344  
 345  
 346  Object.defineProperty(exports, "__esModule", {
 347    value: true
 348  });
 349  exports.wrapControls = exports.asyncControls = exports.create = undefined;
 350  
 351  var _helpers = __webpack_require__(273);
 352  
 353  Object.keys(_helpers).forEach(function (key) {
 354    if (key === "default") return;
 355    Object.defineProperty(exports, key, {
 356      enumerable: true,
 357      get: function get() {
 358        return _helpers[key];
 359      }
 360    });
 361  });
 362  
 363  var _create = __webpack_require__(447);
 364  
 365  var _create2 = _interopRequireDefault(_create);
 366  
 367  var _async = __webpack_require__(449);
 368  
 369  var _async2 = _interopRequireDefault(_async);
 370  
 371  var _wrap = __webpack_require__(451);
 372  
 373  var _wrap2 = _interopRequireDefault(_wrap);
 374  
 375  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 376  
 377  exports.create = _create2.default;
 378  exports.asyncControls = _async2.default;
 379  exports.wrapControls = _wrap2.default;
 380  
 381  /***/ }),
 382  
 383  /***/ 447:
 384  /***/ (function(module, exports, __webpack_require__) {
 385  
 386  "use strict";
 387  
 388  
 389  Object.defineProperty(exports, "__esModule", {
 390    value: true
 391  });
 392  
 393  var _builtin = __webpack_require__(448);
 394  
 395  var _builtin2 = _interopRequireDefault(_builtin);
 396  
 397  var _is = __webpack_require__(166);
 398  
 399  var _is2 = _interopRequireDefault(_is);
 400  
 401  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 402  
 403  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
 404  
 405  var create = function create() {
 406    var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
 407  
 408    var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default));
 409  
 410    var runtime = function runtime(input) {
 411      var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1];
 412      var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2];
 413  
 414      var iterate = function iterate(gen) {
 415        var yieldValue = function yieldValue(isError) {
 416          return function (ret) {
 417            try {
 418              var _ref = isError ? gen.throw(ret) : gen.next(ret);
 419  
 420              var value = _ref.value;
 421              var done = _ref.done;
 422  
 423              if (done) return success(value);
 424              next(value);
 425            } catch (e) {
 426              return error(e);
 427            }
 428          };
 429        };
 430  
 431        var next = function next(ret) {
 432          controls.some(function (control) {
 433            return control(ret, next, runtime, yieldValue(false), yieldValue(true));
 434          });
 435        };
 436  
 437        yieldValue(false)();
 438      };
 439  
 440      var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() {
 441        return regeneratorRuntime.wrap(function _callee$(_context) {
 442          while (1) {
 443            switch (_context.prev = _context.next) {
 444              case 0:
 445                _context.next = 2;
 446                return input;
 447  
 448              case 2:
 449                return _context.abrupt('return', _context.sent);
 450  
 451              case 3:
 452              case 'end':
 453                return _context.stop();
 454            }
 455          }
 456        }, _callee, this);
 457      })();
 458  
 459      iterate(iterator, success, error);
 460    };
 461  
 462    return runtime;
 463  };
 464  
 465  exports.default = create;
 466  
 467  /***/ }),
 468  
 469  /***/ 448:
 470  /***/ (function(module, exports, __webpack_require__) {
 471  
 472  "use strict";
 473  
 474  
 475  Object.defineProperty(exports, "__esModule", {
 476    value: true
 477  });
 478  exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined;
 479  
 480  var _is = __webpack_require__(166);
 481  
 482  var _is2 = _interopRequireDefault(_is);
 483  
 484  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 485  
 486  var any = exports.any = function any(value, next, rungen, yieldNext) {
 487    yieldNext(value);
 488    return true;
 489  };
 490  
 491  var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) {
 492    if (!_is2.default.error(value)) return false;
 493    raiseNext(value.error);
 494    return true;
 495  };
 496  
 497  var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) {
 498    if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false;
 499    var result = {};
 500    var keys = Object.keys(value.value);
 501    var count = 0;
 502    var hasError = false;
 503    var gotResultSuccess = function gotResultSuccess(key, ret) {
 504      if (hasError) return;
 505      result[key] = ret;
 506      count++;
 507      if (count === keys.length) {
 508        yieldNext(result);
 509      }
 510    };
 511  
 512    var gotResultError = function gotResultError(key, error) {
 513      if (hasError) return;
 514      hasError = true;
 515      raiseNext(error);
 516    };
 517  
 518    keys.map(function (key) {
 519      rungen(value.value[key], function (ret) {
 520        return gotResultSuccess(key, ret);
 521      }, function (err) {
 522        return gotResultError(key, err);
 523      });
 524    });
 525  
 526    return true;
 527  };
 528  
 529  var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) {
 530    if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false;
 531    var result = [];
 532    var count = 0;
 533    var hasError = false;
 534    var gotResultSuccess = function gotResultSuccess(key, ret) {
 535      if (hasError) return;
 536      result[key] = ret;
 537      count++;
 538      if (count === value.value.length) {
 539        yieldNext(result);
 540      }
 541    };
 542  
 543    var gotResultError = function gotResultError(key, error) {
 544      if (hasError) return;
 545      hasError = true;
 546      raiseNext(error);
 547    };
 548  
 549    value.value.map(function (v, key) {
 550      rungen(v, function (ret) {
 551        return gotResultSuccess(key, ret);
 552      }, function (err) {
 553        return gotResultError(key, err);
 554      });
 555    });
 556  
 557    return true;
 558  };
 559  
 560  var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) {
 561    if (!_is2.default.iterator(value)) return false;
 562    rungen(value, next, raiseNext);
 563    return true;
 564  };
 565  
 566  exports.default = [error, iterator, array, object, any];
 567  
 568  /***/ }),
 569  
 570  /***/ 449:
 571  /***/ (function(module, exports, __webpack_require__) {
 572  
 573  "use strict";
 574  
 575  
 576  Object.defineProperty(exports, "__esModule", {
 577    value: true
 578  });
 579  exports.race = exports.join = exports.fork = exports.promise = undefined;
 580  
 581  var _is = __webpack_require__(166);
 582  
 583  var _is2 = _interopRequireDefault(_is);
 584  
 585  var _helpers = __webpack_require__(273);
 586  
 587  var _dispatcher = __webpack_require__(450);
 588  
 589  var _dispatcher2 = _interopRequireDefault(_dispatcher);
 590  
 591  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 592  
 593  var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) {
 594    if (!_is2.default.promise(value)) return false;
 595    value.then(next, raiseNext);
 596    return true;
 597  };
 598  
 599  var forkedTasks = new Map();
 600  var fork = exports.fork = function fork(value, next, rungen) {
 601    if (!_is2.default.fork(value)) return false;
 602    var task = Symbol('fork');
 603    var dispatcher = (0, _dispatcher2.default)();
 604    forkedTasks.set(task, dispatcher);
 605    rungen(value.iterator.apply(null, value.args), function (result) {
 606      return dispatcher.dispatch(result);
 607    }, function (err) {
 608      return dispatcher.dispatch((0, _helpers.error)(err));
 609    });
 610    var unsubscribe = dispatcher.subscribe(function () {
 611      unsubscribe();
 612      forkedTasks.delete(task);
 613    });
 614    next(task);
 615    return true;
 616  };
 617  
 618  var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) {
 619    if (!_is2.default.join(value)) return false;
 620    var dispatcher = forkedTasks.get(value.task);
 621    if (!dispatcher) {
 622      raiseNext('join error : task not found');
 623    } else {
 624      (function () {
 625        var unsubscribe = dispatcher.subscribe(function (result) {
 626          unsubscribe();
 627          next(result);
 628        });
 629      })();
 630    }
 631    return true;
 632  };
 633  
 634  var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) {
 635    if (!_is2.default.race(value)) return false;
 636    var finished = false;
 637    var success = function success(result, k, v) {
 638      if (finished) return;
 639      finished = true;
 640      result[k] = v;
 641      next(result);
 642    };
 643  
 644    var fail = function fail(err) {
 645      if (finished) return;
 646      raiseNext(err);
 647    };
 648    if (_is2.default.array(value.competitors)) {
 649      (function () {
 650        var result = value.competitors.map(function () {
 651          return false;
 652        });
 653        value.competitors.forEach(function (competitor, index) {
 654          rungen(competitor, function (output) {
 655            return success(result, index, output);
 656          }, fail);
 657        });
 658      })();
 659    } else {
 660      (function () {
 661        var result = Object.keys(value.competitors).reduce(function (p, c) {
 662          p[c] = false;
 663          return p;
 664        }, {});
 665        Object.keys(value.competitors).forEach(function (index) {
 666          rungen(value.competitors[index], function (output) {
 667            return success(result, index, output);
 668          }, fail);
 669        });
 670      })();
 671    }
 672    return true;
 673  };
 674  
 675  var subscribe = function subscribe(value, next) {
 676    if (!_is2.default.subscribe(value)) return false;
 677    if (!_is2.default.channel(value.channel)) {
 678      throw new Error('the first argument of "subscribe" must be a valid channel');
 679    }
 680    var unsubscribe = value.channel.subscribe(function (ret) {
 681      unsubscribe && unsubscribe();
 682      next(ret);
 683    });
 684  
 685    return true;
 686  };
 687  
 688  exports.default = [promise, fork, join, race, subscribe];
 689  
 690  /***/ }),
 691  
 692  /***/ 450:
 693  /***/ (function(module, exports, __webpack_require__) {
 694  
 695  "use strict";
 696  
 697  
 698  Object.defineProperty(exports, "__esModule", {
 699    value: true
 700  });
 701  var createDispatcher = function createDispatcher() {
 702    var listeners = [];
 703  
 704    return {
 705      subscribe: function subscribe(listener) {
 706        listeners.push(listener);
 707        return function () {
 708          listeners = listeners.filter(function (l) {
 709            return l !== listener;
 710          });
 711        };
 712      },
 713      dispatch: function dispatch(action) {
 714        listeners.slice().forEach(function (listener) {
 715          return listener(action);
 716        });
 717      }
 718    };
 719  };
 720  
 721  exports.default = createDispatcher;
 722  
 723  /***/ }),
 724  
 725  /***/ 451:
 726  /***/ (function(module, exports, __webpack_require__) {
 727  
 728  "use strict";
 729  
 730  
 731  Object.defineProperty(exports, "__esModule", {
 732    value: true
 733  });
 734  exports.cps = exports.call = undefined;
 735  
 736  var _is = __webpack_require__(166);
 737  
 738  var _is2 = _interopRequireDefault(_is);
 739  
 740  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
 741  
 742  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
 743  
 744  var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) {
 745    if (!_is2.default.call(value)) return false;
 746    try {
 747      next(value.func.apply(value.context, value.args));
 748    } catch (err) {
 749      raiseNext(err);
 750    }
 751    return true;
 752  };
 753  
 754  var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) {
 755    var _value$func;
 756  
 757    if (!_is2.default.cps(value)) return false;
 758    (_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) {
 759      if (err) raiseNext(err);else next(result);
 760    }]));
 761    return true;
 762  };
 763  
 764  exports.default = [call, cps];
 765  
 766  /***/ }),
 767  
 768  /***/ 484:
 769  /***/ (function(module, __webpack_exports__, __webpack_require__) {
 770  
 771  "use strict";
 772  // ESM COMPAT FLAG
 773  __webpack_require__.r(__webpack_exports__);
 774  
 775  // EXPORTS
 776  __webpack_require__.d(__webpack_exports__, "default", function() { return /* binding */ createMiddleware; });
 777  
 778  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-generator.js
 779  /**
 780   * Returns true if the given object is a generator, or false otherwise.
 781   *
 782   * @see https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects
 783   *
 784   * @param {*} object Object to test.
 785   *
 786   * @return {boolean} Whether object is a generator.
 787   */
 788  function isGenerator(object) {
 789    // Check that iterator (next) and iterable (Symbol.iterator) interfaces are satisfied.
 790    // These checks seem to be compatible with several generator helpers as well as the native implementation.
 791    return !!object && typeof object[Symbol.iterator] === 'function' && typeof object.next === 'function';
 792  }
 793  
 794  // EXTERNAL MODULE: ./node_modules/rungen/dist/index.js
 795  var dist = __webpack_require__(294);
 796  
 797  // EXTERNAL MODULE: external "lodash"
 798  var external_lodash_ = __webpack_require__(2);
 799  
 800  // EXTERNAL MODULE: ./node_modules/is-promise/index.js
 801  var is_promise = __webpack_require__(153);
 802  var is_promise_default = /*#__PURE__*/__webpack_require__.n(is_promise);
 803  
 804  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/is-action.js
 805  /**
 806   * External dependencies
 807   */
 808  
 809  /**
 810   * Returns true if the given object quacks like an action.
 811   *
 812   * @param {*} object Object to test
 813   *
 814   * @return {boolean}  Whether object is an action.
 815   */
 816  
 817  function isAction(object) {
 818    return Object(external_lodash_["isPlainObject"])(object) && Object(external_lodash_["isString"])(object.type);
 819  }
 820  /**
 821   * Returns true if the given object quacks like an action and has a specific
 822   * action type
 823   *
 824   * @param {*}      object       Object to test
 825   * @param {string} expectedType The expected type for the action.
 826   *
 827   * @return {boolean} Whether object is an action and is of specific type.
 828   */
 829  
 830  function isActionOfType(object, expectedType) {
 831    return isAction(object) && object.type === expectedType;
 832  }
 833  
 834  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/runtime.js
 835  /**
 836   * External dependencies
 837   */
 838  
 839  
 840  
 841  /**
 842   * Internal dependencies
 843   */
 844  
 845  
 846  /**
 847   * Create a co-routine runtime.
 848   *
 849   * @param {Object}    controls Object of control handlers.
 850   * @param {Function}  dispatch Unhandled action dispatch.
 851   *
 852   * @return {Function} co-routine runtime
 853   */
 854  
 855  function createRuntime() {
 856    var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 857    var dispatch = arguments.length > 1 ? arguments[1] : undefined;
 858    var rungenControls = Object(external_lodash_["map"])(controls, function (control, actionType) {
 859      return function (value, next, iterate, yieldNext, yieldError) {
 860        if (!isActionOfType(value, actionType)) {
 861          return false;
 862        }
 863  
 864        var routine = control(value);
 865  
 866        if (is_promise_default()(routine)) {
 867          // Async control routine awaits resolution.
 868          routine.then(yieldNext, yieldError);
 869        } else {
 870          yieldNext(routine);
 871        }
 872  
 873        return true;
 874      };
 875    });
 876  
 877    var unhandledActionControl = function unhandledActionControl(value, next) {
 878      if (!isAction(value)) {
 879        return false;
 880      }
 881  
 882      dispatch(value);
 883      next();
 884      return true;
 885    };
 886  
 887    rungenControls.push(unhandledActionControl);
 888    var rungenRuntime = Object(dist["create"])(rungenControls);
 889    return function (action) {
 890      return new Promise(function (resolve, reject) {
 891        return rungenRuntime(action, function (result) {
 892          if (isAction(result)) {
 893            dispatch(result);
 894          }
 895  
 896          resolve(result);
 897        }, reject);
 898      });
 899    };
 900  }
 901  
 902  // CONCATENATED MODULE: ./node_modules/@wordpress/redux-routine/build-module/index.js
 903  /**
 904   * Internal dependencies
 905   */
 906  
 907  
 908  /**
 909   * Creates a Redux middleware, given an object of controls where each key is an
 910   * action type for which to act upon, the value a function which returns either
 911   * a promise which is to resolve when evaluation of the action should continue,
 912   * or a value. The value or resolved promise value is assigned on the return
 913   * value of the yield assignment. If the control handler returns undefined, the
 914   * execution is not continued.
 915   *
 916   * @param {Object} controls Object of control handlers.
 917   *
 918   * @return {Function} Co-routine runtime
 919   */
 920  
 921  function createMiddleware() {
 922    var controls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
 923    return function (store) {
 924      var runtime = createRuntime(controls, store.dispatch);
 925      return function (next) {
 926        return function (action) {
 927          if (!isGenerator(action)) {
 928            return next(action);
 929          }
 930  
 931          return runtime(action);
 932        };
 933      };
 934    };
 935  }
 936  
 937  
 938  /***/ })
 939  
 940  /******/ })["default"];


Generated: Sun Mar 7 01:00:03 2021 Cross-referenced by PHPXref 0.7.1