[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

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


Generated: Sat Nov 23 20:47:33 2019 Cross-referenced by PHPXref 0.7