asva-executors
Advanced tools
Comparing version 0.1.23 to 0.1.24
@@ -10,2 +10,2 @@ import CacheExecutor from './modules/Executors/CacheExecutor'; | ||
import { StatefulExecutor } from './modules/Executors/StatefulExecutor'; | ||
export { CacheExecutor, Executor, LadderExecutor, StatefulExecutor, DebounceLoader, RepeatLoader, InfiniteLoader, RetrierExecutor, InfiniteLoaderFactory }; | ||
export { CacheExecutor, Executor, LadderExecutor, StatefulExecutor, DebounceLoader, RepeatLoader, InfiniteLoader, RetrierExecutor, InfiniteLoaderFactory, }; |
@@ -1,241 +0,299 @@ | ||
(function webpackUniversalModuleDefinition(root, factory) { | ||
if(typeof exports === 'object' && typeof module === 'object') | ||
module.exports = factory(); | ||
else if(typeof define === 'function' && define.amd) | ||
define([], factory); | ||
else { | ||
var a = factory(); | ||
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; | ||
} | ||
})(Function("return this")(), function() { | ||
return /******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {} | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // define __esModule on exports | ||
/******/ __webpack_require__.r = function(exports) { | ||
/******/ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = "/"; | ||
/******/ | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts"); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ({ | ||
!function (t, e) { | ||
if ('object' == typeof exports && 'object' == typeof module) module.exports = e(require('tslib')) else if ('function' == typeof define && define.amd) define(['tslib'], e) else { | ||
var n = 'object' == typeof exports ? e(require('tslib')) : e(t.tslib) | ||
for (var i in n) ('object' == typeof exports ? exports : t)[i] = n[i] | ||
} | ||
}(Function('return this')(), (function (t) { | ||
return (() => { | ||
'use strict' | ||
var e = { | ||
780: e => { | ||
e.exports = t | ||
}, | ||
}, n = {} | ||
/***/ "./node_modules/tslib/tslib.es6.js": | ||
/*!*****************************************!*\ | ||
!*** ./node_modules/tslib/tslib.es6.js ***! | ||
\*****************************************/ | ||
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
function i (t) { | ||
var r = n[t] | ||
if (void 0 !== r) return r.exports | ||
var o = n[t] = { exports: {} } | ||
return e[t](o, o.exports, i), o.exports | ||
} | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__extends\", function() { return __extends; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__rest\", function() { return __rest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__decorate\", function() { return __decorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__param\", function() { return __param; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__metadata\", function() { return __metadata; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__awaiter\", function() { return __awaiter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__generator\", function() { return __generator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__exportStar\", function() { return __exportStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__values\", function() { return __values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__read\", function() { return __read; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spread\", function() { return __spread; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__await\", function() { return __await; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncGenerator\", function() { return __asyncGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncDelegator\", function() { return __asyncDelegator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncValues\", function() { return __asyncValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__makeTemplateObject\", function() { return __makeTemplateObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importStar\", function() { return __importStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importDefault\", function() { return __importDefault; });\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nfunction __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/tslib/tslib.es6.js?"); | ||
i.d = (t, e) => { | ||
for (var n in e) i.o(e, n) && !i.o(t, n) && Object.defineProperty(t, n, { | ||
enumerable: !0, | ||
get: e[n], | ||
}) | ||
}, i.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), i.r = t => { | ||
'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), Object.defineProperty(t, '__esModule', { value: !0 }) | ||
} | ||
var r = {} | ||
return (() => { | ||
i.r(r), i.d(r, { | ||
CacheExecutor: () => n, | ||
DebounceLoader: () => s, | ||
Executor: () => e, | ||
InfiniteLoader: () => c, | ||
InfiniteLoaderFactory: () => f, | ||
LadderExecutor: () => o, | ||
RepeatLoader: () => u, | ||
RetrierExecutor: () => h, | ||
StatefulExecutor: () => l, | ||
}) | ||
var t = i(780) | ||
const e = function () { | ||
function t (t) { | ||
this.runCount = 0, this.wasLastRunFine = !1, this.wasRun = !1, this.wasRunFine = !1, this.wasRunBad = !1, this.command = t | ||
} | ||
/***/ }), | ||
return t.createAndRun = function (e) { | ||
var n = new t(e) | ||
return n.run(), n | ||
}, Object.defineProperty(t.prototype, 'isRunning', { | ||
get: function () { | ||
return !!this.runCount | ||
}, enumerable: !1, configurable: !0, | ||
}), t.prototype.run = function () { | ||
for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e] | ||
this.beforeRun() | ||
var n = this.command.apply(this, t) | ||
return this.afterRun(n), n | ||
}, t.prototype.beforeRun = function () { | ||
this.runCount++ | ||
}, t.prototype.afterRun = function (t) { | ||
var e = this | ||
t.then((function () { | ||
e.runCount--, e.setRunResultFlags(!0) | ||
})), t.catch((function () { | ||
e.runCount--, e.setRunResultFlags(!1) | ||
})) | ||
}, t.prototype.setRunResultFlags = function (t) { | ||
this.wasRun = !0, this.wasLastRunFine = t, t && (this.wasRunFine = !0), t || (this.wasRunBad = !0) | ||
}, t | ||
}(), n = function (e) { | ||
function n () { | ||
var t = null !== e && e.apply(this, arguments) || this | ||
return t.cachedPromise = null, t | ||
} | ||
/***/ "./src/index.ts": | ||
/*!**********************!*\ | ||
!*** ./src/index.ts ***! | ||
\**********************/ | ||
/*! exports provided: CacheExecutor, Executor, LadderExecutor, StatefulExecutor, DebounceLoader, RepeatLoader, InfiniteLoader, RetrierExecutor, InfiniteLoaderFactory */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
return (0, t.__extends)(n, e), n.prototype.run = function () { | ||
for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n] | ||
return this.cachedPromise || (this.cachedPromise = e.prototype.run.apply(this, t)), this.cachedPromise | ||
}, n.prototype.runFresh = function () { | ||
for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n] | ||
return this.cachedPromise = e.prototype.run.apply(this, t), this.cachedPromise | ||
}, n.prototype.cleanCache = function () { | ||
this.cachedPromise = null | ||
}, n | ||
}(e), o = function (e) { | ||
function n () { | ||
var t = null !== e && e.apply(this, arguments) || this | ||
return t.trigger = null, t | ||
} | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _modules_Executors_CacheExecutor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modules/Executors/CacheExecutor */ \"./src/modules/Executors/CacheExecutor.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CacheExecutor\", function() { return _modules_Executors_CacheExecutor__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _modules_Executors_Executor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modules/Executors/Executor */ \"./src/modules/Executors/Executor.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Executor\", function() { return _modules_Executors_Executor__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _modules_Executors_LadderExecutor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/Executors/LadderExecutor */ \"./src/modules/Executors/LadderExecutor.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LadderExecutor\", function() { return _modules_Executors_LadderExecutor__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _modules_Loaders_DebounceLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/Loaders/DebounceLoader */ \"./src/modules/Loaders/DebounceLoader.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DebounceLoader\", function() { return _modules_Loaders_DebounceLoader__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _modules_Loaders_RepeatLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/Loaders/RepeatLoader */ \"./src/modules/Loaders/RepeatLoader.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RepeatLoader\", function() { return _modules_Loaders_RepeatLoader__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _modules_Loaders_InfiniteLoader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/Loaders/InfiniteLoader */ \"./src/modules/Loaders/InfiniteLoader.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InfiniteLoader\", function() { return _modules_Loaders_InfiniteLoader__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _modules_Loaders_RetrierExecutor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/Loaders/RetrierExecutor */ \"./src/modules/Loaders/RetrierExecutor.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RetrierExecutor\", function() { return _modules_Loaders_RetrierExecutor__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _modules_Loaders_InfiniteLoaderFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modules/Loaders/InfiniteLoaderFactory */ \"./src/modules/Loaders/InfiniteLoaderFactory.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InfiniteLoaderFactory\", function() { return _modules_Loaders_InfiniteLoaderFactory__WEBPACK_IMPORTED_MODULE_7__[\"InfiniteLoaderFactory\"]; });\n\n/* harmony import */ var _modules_Executors_StatefulExecutor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./modules/Executors/StatefulExecutor */ \"./src/modules/Executors/StatefulExecutor.ts\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StatefulExecutor\", function() { return _modules_Executors_StatefulExecutor__WEBPACK_IMPORTED_MODULE_8__[\"StatefulExecutor\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n//# sourceURL=webpack:///./src/index.ts?"); | ||
return (0, t.__extends)(n, e), n.prototype.run = function () { | ||
for (var t = this, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i] | ||
if (!this.isRunning) { | ||
var r = e.prototype.run.apply(this, n) | ||
return r.then((function () { | ||
t.trigger && t.trigger(), t.trigger = null | ||
})), r | ||
} | ||
return new Promise((function (e) { | ||
t.trigger = function () { | ||
return t.run.apply(t, n).then(e) | ||
} | ||
})) | ||
}, n | ||
}(e), s = function () { | ||
function t (t, n) { | ||
void 0 === n && (n = 3e3), this.identityCheck = {}, this.isWaiting = !1, this.executor = new e(t), this.timeout = n | ||
} | ||
/***/ }), | ||
return Object.defineProperty(t.prototype, 'isRunning', { | ||
get: function () { | ||
return this.executor.isRunning | ||
}, enumerable: !1, configurable: !0, | ||
}), Object.defineProperty(t.prototype, 'isActive', { | ||
get: function () { | ||
return this.isRunning || this.isWaiting | ||
}, enumerable: !1, configurable: !0, | ||
}), t.prototype.run = function () { | ||
for (var t = this, e = [], n = 0; n < arguments.length; n++) e[n] = arguments[n] | ||
this.isWaiting = !0 | ||
var i = this.registerIdentity() | ||
setTimeout((function () { | ||
var n | ||
t.checkIdentity(i) && (t.isWaiting = !1, (n = t.executor).run.apply(n, e)) | ||
}), this.timeout) | ||
}, t.prototype.reset = function () { | ||
this.isWaiting = !1, this.identityCheck = {} | ||
}, t.prototype.registerIdentity = function () { | ||
return this.identityCheck = {}, this.identityCheck | ||
}, t.prototype.checkIdentity = function (t) { | ||
return this.identityCheck === t | ||
}, t | ||
}(), u = function () { | ||
function t (t, e) { | ||
this.time = 100, this.id = null, this.command = t, this.time = e | ||
} | ||
/***/ "./src/modules/Executors/CacheExecutor.ts": | ||
/*!************************************************!*\ | ||
!*** ./src/modules/Executors/CacheExecutor.ts ***! | ||
\************************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
return t.prototype.start = function () { | ||
this.id || (this.id = setInterval(this.command, this.time)) | ||
}, t.prototype.stop = function () { | ||
this.id && clearInterval(this.id), this.id = null | ||
}, t | ||
}(), c = function () { | ||
function e (e, n) { | ||
var i = this | ||
void 0 === n && (n = 20), this.items = [], this.isFinished = !1, this.isRefreshing = !1, this.perStep = 20, this.pointer = 0, this.isFresh = !0, this.executor = new o((function (n) { | ||
return void 0 === n && (n = !1), (0, t.__awaiter)(i, void 0, void 0, (function () { | ||
return (0, t.__generator)(this, (function (t) { | ||
switch (t.label) { | ||
case 0: | ||
return [4, this.runRequest(e, n)] | ||
case 1: | ||
return [2, t.sent()] | ||
} | ||
})) | ||
})) | ||
})), this.perStep = n | ||
} | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _Executor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Executor */ \"./src/modules/Executors/Executor.ts\");\n\r\n\r\n/**\r\n * This executor caches first run result and provides it for all subsequent calls.\r\n */\r\nvar CacheExecutor = /** @class */ (function (_super) {\r\n tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"](CacheExecutor, _super);\r\n function CacheExecutor() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.cachedPromise = null;\r\n return _this;\r\n }\r\n /**\r\n * Run command and cache promise.\r\n */\r\n CacheExecutor.prototype.run = function () {\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n if (!this.cachedPromise) {\r\n this.cachedPromise = _super.prototype.run.apply(this, parameters);\r\n }\r\n return this.cachedPromise;\r\n };\r\n /**\r\n * Run executor without cache. Promise will be put to cache though.\r\n */\r\n CacheExecutor.prototype.runFresh = function () {\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n this.cachedPromise = _super.prototype.run.apply(this, parameters);\r\n return this.cachedPromise;\r\n };\r\n /**\r\n * Just clean cache.\r\n */\r\n CacheExecutor.prototype.cleanCache = function () {\r\n this.cachedPromise = null;\r\n };\r\n return CacheExecutor;\r\n}(_Executor__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (CacheExecutor);\r\n\n\n//# sourceURL=webpack:///./src/modules/Executors/CacheExecutor.ts?"); | ||
return Object.defineProperty(e.prototype, 'isRunning', { | ||
get: function () { | ||
return this.executor.isRunning | ||
}, enumerable: !1, configurable: !0, | ||
}), Object.defineProperty(e.prototype, 'isEmpty', { | ||
get: function () { | ||
return !this.executor.isRunning && this.isFinished && 0 === this.items.length | ||
}, enumerable: !1, configurable: !0, | ||
}), Object.defineProperty(e.prototype, 'isFull', { | ||
get: function () { | ||
return !this.isFresh && !this.executor.isRunning && !!this.items.length | ||
}, enumerable: !1, configurable: !0, | ||
}), e.prototype.next = function () { | ||
this.executor.run() | ||
}, e.prototype.refresh = function () { | ||
this.executor.run(!0) | ||
}, e.prototype.runRequest = function (e, n) { | ||
return void 0 === n && (n = !1), (0, t.__awaiter)(this, void 0, void 0, (function () { | ||
var i, r | ||
return (0, t.__generator)(this, (function (t) { | ||
switch (t.label) { | ||
case 0: | ||
0 === this.pointer && (n = !0), n && (this.pointer = 0, this.isFresh = !0, this.isRefreshing = !0, this.isFinished = !1), t.label = 1 | ||
case 1: | ||
return t.trys.push([1, 3, 4, 5]), [4, e(this.pointer, this.perStep)] | ||
case 2: | ||
return i = t.sent(), Array.isArray(i) ? (i.length < this.perStep && (this.isFinished = !0), this.applyNew(i), this.pointer = this.pointer + this.perStep, this.isFresh = !1, [3, 5]) : (console.warn('InfiniteLoader function must return array'), [2]) | ||
case 3: | ||
throw r = t.sent(), this.isFinished = !0, r | ||
case 4: | ||
return this.isRefreshing = !1, [7] | ||
case 5: | ||
return [2] | ||
} | ||
})) | ||
})) | ||
}, e.prototype.applyNew = function (e) { | ||
this.isFresh ? this.items = e : this.items = (0, t.__spreadArray)((0, t.__spreadArray)([], this.items), e) | ||
}, e | ||
}(), a = function () { | ||
function t () { | ||
} | ||
/***/ }), | ||
return t.sleep = function (t) { | ||
return new Promise((function (e) { | ||
return setTimeout(e, t) | ||
})) | ||
}, t | ||
}(), h = function () { | ||
function e (t, e, n) { | ||
void 0 === e && (e = 100), void 0 === n && (n = 1e3), this.iterationCount = 0, this.command = t, this.timeout = e, this.maxTime = n | ||
} | ||
/***/ "./src/modules/Executors/Executor.ts": | ||
/*!*******************************************!*\ | ||
!*** ./src/modules/Executors/Executor.ts ***! | ||
\*******************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
return e.waitUntil = function (n, i, r) { | ||
return (0, t.__awaiter)(this, void 0, void 0, (function () { | ||
return (0, t.__generator)(this, (function (t) { | ||
switch (t.label) { | ||
case 0: | ||
return [4, new e(n, i, r).run()] | ||
case 1: | ||
return t.sent(), [2] | ||
} | ||
})) | ||
})) | ||
}, Object.defineProperty(e.prototype, 'timeElapsed', { | ||
get: function () { | ||
return this.timeout * this.iterationCount | ||
}, enumerable: !1, configurable: !0, | ||
}), e.prototype.takesTooLong = function () { | ||
return this.timeElapsed > this.maxTime | ||
}, e.prototype.run = function () { | ||
return (0, t.__awaiter)(this, void 0, void 0, (function () { | ||
var e | ||
return (0, t.__generator)(this, (function (t) { | ||
switch (t.label) { | ||
case 0: | ||
this.iterationCount = 0, e = this.command(), t.label = 1 | ||
case 1: | ||
return e ? [3, 3] : [4, a.sleep(this.timeout)] | ||
case 2: | ||
if (t.sent(), this.iterationCount++, this.takesTooLong()) throw new Error('Max time (' + this.maxTime + ') elapsed.') | ||
return e = this.command(), [3, 1] | ||
case 3: | ||
return [2] | ||
} | ||
})) | ||
})) | ||
}, e | ||
}(), p = function () { | ||
function t () { | ||
} | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\nvar Executor = /** @class */ (function () {\r\n function Executor(command) {\r\n /**\r\n * Currently running commands\r\n */\r\n this.runCount = 0; //\r\n /**\r\n * Last executor run happened without an error\r\n */\r\n this.wasLastRunFine = false; //\r\n /**\r\n * Executor was run at least once\r\n */\r\n this.wasRun = false;\r\n /**\r\n * Executor was run without throwing error at least once\r\n */\r\n this.wasRunFine = false;\r\n /**\r\n * Executor was run with thrown error at least once\r\n */\r\n this.wasRunBad = false;\r\n this.command = command;\r\n }\r\n Executor.createAndRun = function (command) {\r\n var executor = new Executor(command);\r\n executor.run();\r\n return executor;\r\n };\r\n Object.defineProperty(Executor.prototype, \"isRunning\", {\r\n /**\r\n * Command from this executor is currently running.\r\n */\r\n get: function () {\r\n return !!this.runCount;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @param parameters Arguments, will be passed down to command.\r\n * @returns {Promise<any>} Promise result is formed from whatever you returned from command.\r\n */\r\n Executor.prototype.run = function () {\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n this.beforeRun();\r\n var promise = this.command.apply(this, parameters);\r\n // NOTE This check was broken on second package import (package one < package two < executor)\r\n // if (!(promise instanceof Promise)) {\r\n // throw new Error('Executor command should return promise.')\r\n // }\r\n this.afterRun(promise);\r\n return promise;\r\n };\r\n Executor.prototype.beforeRun = function () {\r\n this.runCount++;\r\n };\r\n Executor.prototype.afterRun = function (promise) {\r\n var _this = this;\r\n promise.then(function () {\r\n _this.runCount--;\r\n _this.setRunResultFlags(true);\r\n });\r\n promise.catch(function () {\r\n _this.runCount--;\r\n _this.setRunResultFlags(false);\r\n });\r\n };\r\n Executor.prototype.setRunResultFlags = function (success) {\r\n this.wasRun = true;\r\n this.wasLastRunFine = success;\r\n if (success) {\r\n this.wasRunFine = true;\r\n }\r\n if (!success) {\r\n this.wasRunBad = true;\r\n }\r\n };\r\n return Executor;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (Executor);\r\n\n\n//# sourceURL=webpack:///./src/modules/Executors/Executor.ts?"); | ||
return t.getPointerRequest = function (t) { | ||
return void 0 === t && (t = 100), function (e, n) { | ||
return new Promise((function (i) { | ||
setTimeout((function () { | ||
var t | ||
i((t = e, Array(e + n - t).fill(0).map((function (e, n) { | ||
return t + n | ||
})))) | ||
}), t) | ||
})) | ||
} | ||
}, t | ||
}() | ||
var f = function () { | ||
function t () { | ||
} | ||
/***/ }), | ||
return t.createNumberedList = function (t) { | ||
void 0 === t && (t = 300) | ||
var e = p.getPointerRequest(t) | ||
return new c(e, 10) | ||
}, t | ||
}(), l = function (e) { | ||
function n (t, n) { | ||
void 0 === n && (n = null) | ||
var i = e.call(this, t) || this | ||
return i.state = n, i | ||
} | ||
/***/ "./src/modules/Executors/LadderExecutor.ts": | ||
/*!*************************************************!*\ | ||
!*** ./src/modules/Executors/LadderExecutor.ts ***! | ||
\*************************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _Executor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Executor */ \"./src/modules/Executors/Executor.ts\");\n\r\n\r\n/**\r\n * This executor will chain requests ladder-like.\r\n * Last one will always be executed.\r\n * For skipped requests the promise will never be resolved.\r\n */\r\nvar LadderExecutor = /** @class */ (function (_super) {\r\n tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"](LadderExecutor, _super);\r\n function LadderExecutor() {\r\n var _this = _super !== null && _super.apply(this, arguments) || this;\r\n _this.trigger = null;\r\n return _this;\r\n }\r\n LadderExecutor.prototype.run = function () {\r\n var _this = this;\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n if (!this.isRunning) {\r\n var promise = _super.prototype.run.apply(this, parameters);\r\n promise.then(function () {\r\n _this.trigger && _this.trigger();\r\n _this.trigger = null;\r\n });\r\n return promise;\r\n }\r\n return new Promise(function (resolve) {\r\n _this.trigger = function () { return _this.run.apply(_this, parameters).then(resolve); };\r\n });\r\n };\r\n return LadderExecutor;\r\n}(_Executor__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (LadderExecutor);\r\n\n\n//# sourceURL=webpack:///./src/modules/Executors/LadderExecutor.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Executors/StatefulExecutor.ts": | ||
/*!***************************************************!*\ | ||
!*** ./src/modules/Executors/StatefulExecutor.ts ***! | ||
\***************************************************/ | ||
/*! exports provided: StatefulExecutor */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StatefulExecutor\", function() { return StatefulExecutor; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _Executor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Executor */ \"./src/modules/Executors/Executor.ts\");\n\r\n\r\n/**\r\n * This executor keeps state of last result\r\n */\r\nvar StatefulExecutor = /** @class */ (function (_super) {\r\n tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"](StatefulExecutor, _super);\r\n function StatefulExecutor(command, state) {\r\n if (state === void 0) { state = null; }\r\n var _this = _super.call(this, command) || this;\r\n _this.state = state;\r\n return _this;\r\n }\r\n StatefulExecutor.createAndRun = function (command, state) {\r\n if (state === void 0) { state = null; }\r\n var executor = new StatefulExecutor(command, state);\r\n executor.run();\r\n return executor;\r\n };\r\n /**\r\n * Run command and cache promise.\r\n */\r\n StatefulExecutor.prototype.run = function () {\r\n var _this = this;\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n var promise = _super.prototype.run.apply(this, parameters);\r\n promise.then(function (result) {\r\n _this.state = result;\r\n });\r\n return promise;\r\n };\r\n return StatefulExecutor;\r\n}(_Executor__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\r\n\r\n\n\n//# sourceURL=webpack:///./src/modules/Executors/StatefulExecutor.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Helpers/AsyncHelpers.ts": | ||
/*!*********************************************!*\ | ||
!*** ./src/modules/Helpers/AsyncHelpers.ts ***! | ||
\*********************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\nvar AsyncHelpers = /** @class */ (function () {\r\n function AsyncHelpers() {\r\n }\r\n AsyncHelpers.sleep = function (ms) {\r\n return new Promise(function (resolve) { return setTimeout(resolve, ms); });\r\n };\r\n return AsyncHelpers;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (AsyncHelpers);\r\n\n\n//# sourceURL=webpack:///./src/modules/Helpers/AsyncHelpers.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/DebounceLoader.ts": | ||
/*!***********************************************!*\ | ||
!*** ./src/modules/Loaders/DebounceLoader.ts ***! | ||
\***********************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Executors_Executor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Executors/Executor */ \"./src/modules/Executors/Executor.ts\");\n\r\n/**\r\n * When you `run` executor - timer is set on timeout value and starts ticking down.\r\n * If you `run` before the timer is expired - timer is refreshed.\r\n * When timer expires - command is being run.\r\n */\r\nvar DebounceLoader = /** @class */ (function () {\r\n function DebounceLoader(command, timeout) {\r\n if (timeout === void 0) { timeout = 3000; }\r\n this.identityCheck = {};\r\n this.isWaiting = false;\r\n this.executor = new _Executors_Executor__WEBPACK_IMPORTED_MODULE_0__[\"default\"](command);\r\n this.timeout = timeout;\r\n }\r\n Object.defineProperty(DebounceLoader.prototype, \"isRunning\", {\r\n get: function () {\r\n return this.executor.isRunning;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(DebounceLoader.prototype, \"isActive\", {\r\n get: function () {\r\n return this.isRunning || this.isWaiting;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n DebounceLoader.prototype.run = function () {\r\n var _this = this;\r\n var parameters = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n parameters[_i] = arguments[_i];\r\n }\r\n this.isWaiting = true;\r\n var identityKey = this.registerIdentity();\r\n setTimeout(function () {\r\n if (!_this.checkIdentity(identityKey)) {\r\n return;\r\n }\r\n _this.isWaiting = false;\r\n (_a = _this.executor).run.apply(_a, parameters);\r\n var _a;\r\n }, this.timeout);\r\n };\r\n DebounceLoader.prototype.reset = function () {\r\n this.isWaiting = false;\r\n this.identityCheck = {};\r\n };\r\n DebounceLoader.prototype.registerIdentity = function () {\r\n this.identityCheck = {};\r\n return this.identityCheck;\r\n };\r\n DebounceLoader.prototype.checkIdentity = function (key) {\r\n return this.identityCheck === key;\r\n };\r\n return DebounceLoader;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (DebounceLoader);\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/DebounceLoader.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/InfiniteLoader.ts": | ||
/*!***********************************************!*\ | ||
!*** ./src/modules/Loaders/InfiniteLoader.ts ***! | ||
\***********************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _Executors_LadderExecutor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Executors/LadderExecutor */ \"./src/modules/Executors/LadderExecutor.ts\");\n\r\n\r\nvar InfiniteLoader = /** @class */ (function () {\r\n // Is currently running from 0 pointer\r\n function InfiniteLoader(run, perStep) {\r\n if (perStep === void 0) { perStep = 20; }\r\n var _this = this;\r\n this.items = [];\r\n this.isFinished = false;\r\n this.isRefreshing = false;\r\n this.perStep = 20; // number of items to load\r\n this.pointer = 0;\r\n // Means no runs were executed\r\n this.isFresh = true;\r\n this.executor = new _Executors_LadderExecutor__WEBPACK_IMPORTED_MODULE_1__[\"default\"](function (refresh) {\r\n if (refresh === void 0) { refresh = false; }\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](_this, void 0, void 0, function () { return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"](this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.runRequest(run, refresh)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n }); });\r\n });\r\n this.perStep = perStep;\r\n }\r\n Object.defineProperty(InfiniteLoader.prototype, \"isRunning\", {\r\n /**\r\n * Command from this executor is currently running.\r\n */\r\n get: function () {\r\n return this.executor.isRunning;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InfiniteLoader.prototype, \"isEmpty\", {\r\n /**\r\n * We tried to load, but list is empty\r\n * Is false when executor is loading or is fresh.\r\n */\r\n get: function () {\r\n if (this.executor.isRunning) {\r\n return false;\r\n }\r\n return this.isFinished && (this.items.length === 0);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(InfiniteLoader.prototype, \"isFull\", {\r\n /**\r\n * We tried to load, and list is not empty\r\n * Is false when executor is loading or is fresh.\r\n */\r\n get: function () {\r\n if (this.isFresh) {\r\n return false;\r\n }\r\n if (this.executor.isRunning) {\r\n return false;\r\n }\r\n return !!this.items.length;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Loads a bunch of items\r\n */\r\n InfiniteLoader.prototype.next = function () {\r\n this.executor.run();\r\n };\r\n /**\r\n * Refresh the list.\r\n */\r\n InfiniteLoader.prototype.refresh = function () {\r\n this.executor.run(true);\r\n };\r\n InfiniteLoader.prototype.runRequest = function (pointerRequest, refresh) {\r\n if (refresh === void 0) { refresh = false; }\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function () {\r\n var result, exception_1;\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"](this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (this.pointer === 0) {\r\n refresh = true;\r\n }\r\n if (refresh) {\r\n this.pointer = 0;\r\n this.isFresh = true;\r\n this.isRefreshing = true;\r\n this.isFinished = false;\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, 4, 5]);\r\n return [4 /*yield*/, pointerRequest(this.pointer, this.perStep)];\r\n case 2:\r\n result = _a.sent();\r\n if (!Array.isArray(result)) {\r\n console.warn('InfiniteLoader function must return array');\r\n return [2 /*return*/];\r\n }\r\n if (result.length < this.perStep) {\r\n this.isFinished = true;\r\n }\r\n this.applyNew(result);\r\n this.pointer = this.pointer + this.perStep;\r\n this.isFresh = false;\r\n return [3 /*break*/, 5];\r\n case 3:\r\n exception_1 = _a.sent();\r\n this.isFinished = true;\r\n throw exception_1;\r\n case 4:\r\n this.isRefreshing = false;\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n InfiniteLoader.prototype.applyNew = function (items) {\r\n if (this.isFresh) {\r\n this.items = items;\r\n return;\r\n }\r\n this.items = this.items.concat(items);\r\n };\r\n return InfiniteLoader;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (InfiniteLoader);\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/InfiniteLoader.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/InfiniteLoaderFactory.ts": | ||
/*!******************************************************!*\ | ||
!*** ./src/modules/Loaders/InfiniteLoaderFactory.ts ***! | ||
\******************************************************/ | ||
/*! exports provided: InfiniteLoaderFactory */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InfiniteLoaderFactory\", function() { return InfiniteLoaderFactory; });\n/* harmony import */ var _PointerRequestFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PointerRequestFactory */ \"./src/modules/Loaders/PointerRequestFactory.ts\");\n/* harmony import */ var _InfiniteLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InfiniteLoader */ \"./src/modules/Loaders/InfiniteLoader.ts\");\n\r\n\r\nvar InfiniteLoaderFactory = /** @class */ (function () {\r\n function InfiniteLoaderFactory() {\r\n }\r\n /**\r\n * Infinite loader generating a list of numbers by tens\r\n */\r\n InfiniteLoaderFactory.createNumberedList = function (timeout) {\r\n if (timeout === void 0) { timeout = 300; }\r\n var pointerRequest = _PointerRequestFactory__WEBPACK_IMPORTED_MODULE_0__[\"default\"].getPointerRequest(timeout);\r\n return new _InfiniteLoader__WEBPACK_IMPORTED_MODULE_1__[\"default\"](pointerRequest, 10);\r\n };\r\n return InfiniteLoaderFactory;\r\n}());\r\n\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/InfiniteLoaderFactory.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/PointerRequestFactory.ts": | ||
/*!******************************************************!*\ | ||
!*** ./src/modules/Loaders/PointerRequestFactory.ts ***! | ||
\******************************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/**\r\n * Generate an array with sequence of numbers\r\n */\r\nfunction range(start, end) {\r\n var length = (end - start);\r\n return Array(length).fill(0).map(function (item, index) { return start + index; });\r\n}\r\nvar PointerRequestFactory = /** @class */ (function () {\r\n function PointerRequestFactory() {\r\n }\r\n PointerRequestFactory.getPointerRequest = function (timeout) {\r\n if (timeout === void 0) { timeout = 100; }\r\n return function (pointer, perStep) {\r\n return new Promise(function (resolve) {\r\n setTimeout(function () {\r\n resolve(range(pointer, pointer + perStep));\r\n }, timeout);\r\n });\r\n };\r\n };\r\n return PointerRequestFactory;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (PointerRequestFactory);\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/PointerRequestFactory.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/RepeatLoader.ts": | ||
/*!*********************************************!*\ | ||
!*** ./src/modules/Loaders/RepeatLoader.ts ***! | ||
\*********************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/**\r\n * Runs command on timeout.\r\n * Don't forget to stop it or executor would run indefinitely.\r\n */\r\nvar RepeatLoader = /** @class */ (function () {\r\n function RepeatLoader(command, time) {\r\n this.time = 100;\r\n this.id = null;\r\n this.command = command;\r\n this.time = time;\r\n }\r\n RepeatLoader.prototype.start = function () {\r\n if (!this.id) {\r\n this.id = setInterval(this.command, this.time);\r\n }\r\n };\r\n RepeatLoader.prototype.stop = function () {\r\n if (this.id) {\r\n clearInterval(this.id);\r\n }\r\n this.id = null;\r\n };\r\n return RepeatLoader;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (RepeatLoader);\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/RepeatLoader.ts?"); | ||
/***/ }), | ||
/***/ "./src/modules/Loaders/RetrierExecutor.ts": | ||
/*!************************************************!*\ | ||
!*** ./src/modules/Loaders/RetrierExecutor.ts ***! | ||
\************************************************/ | ||
/*! exports provided: default */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _Helpers_AsyncHelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Helpers/AsyncHelpers */ \"./src/modules/Helpers/AsyncHelpers.ts\");\n\r\n\r\nvar RetrierExecutor = /** @class */ (function () {\r\n function RetrierExecutor(command, timeout, maxTime) {\r\n if (timeout === void 0) { timeout = 100; }\r\n if (maxTime === void 0) { maxTime = 1000; }\r\n this.iterationCount = 0;\r\n this.command = command;\r\n this.timeout = timeout;\r\n this.maxTime = maxTime;\r\n }\r\n /**\r\n * Shortcut to use executor functionally.\r\n */\r\n RetrierExecutor.waitUntil = function (command, timeout, maxTime) {\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function () {\r\n var executor;\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"](this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n executor = new RetrierExecutor(command, timeout, maxTime);\r\n return [4 /*yield*/, executor.run()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n Object.defineProperty(RetrierExecutor.prototype, \"timeElapsed\", {\r\n get: function () {\r\n return this.timeout * this.iterationCount;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n RetrierExecutor.prototype.takesTooLong = function () {\r\n return this.timeElapsed > this.maxTime;\r\n };\r\n RetrierExecutor.prototype.run = function () {\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function () {\r\n var result;\r\n return tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"](this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.iterationCount = 0;\r\n result = this.command();\r\n _a.label = 1;\r\n case 1:\r\n if (!!result) return [3 /*break*/, 3];\r\n return [4 /*yield*/, _Helpers_AsyncHelpers__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sleep(this.timeout)];\r\n case 2:\r\n _a.sent();\r\n this.iterationCount++;\r\n if (this.takesTooLong()) {\r\n throw new Error(\"Max time (\" + this.maxTime + \") elapsed.\");\r\n }\r\n result = this.command();\r\n return [3 /*break*/, 1];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return RetrierExecutor;\r\n}());\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (RetrierExecutor);\r\n\n\n//# sourceURL=webpack:///./src/modules/Loaders/RetrierExecutor.ts?"); | ||
/***/ }) | ||
/******/ }); | ||
}); | ||
return (0, t.__extends)(n, e), n.createAndRun = function (t, e) { | ||
void 0 === e && (e = null) | ||
var i = new n(t, e) | ||
return i.run(), i | ||
}, n.prototype.run = function () { | ||
for (var t = this, n = [], i = 0; i < arguments.length; i++) n[i] = arguments[i] | ||
var r = e.prototype.run.apply(this, n) | ||
return r.then((function (e) { | ||
t.state = e | ||
})), r | ||
}, n | ||
}(e) | ||
})(), r | ||
})() | ||
})) | ||
//# sourceMappingURL=index.js.map |
@@ -29,3 +29,3 @@ export declare type ExecutorCommand = (...args: any[]) => Promise<any>; | ||
*/ | ||
readonly isRunning: boolean; | ||
get isRunning(): boolean; | ||
/** | ||
@@ -32,0 +32,0 @@ * @param parameters Arguments, will be passed down to command. |
@@ -13,4 +13,4 @@ import Executor, { ExecutorCommand } from '../Executors/Executor'; | ||
constructor(command: ExecutorCommand, timeout?: number); | ||
readonly isRunning: boolean; | ||
readonly isActive: boolean; | ||
get isRunning(): boolean; | ||
get isActive(): boolean; | ||
run(...parameters: any[]): void; | ||
@@ -17,0 +17,0 @@ reset(): void; |
@@ -15,3 +15,3 @@ import LadderExecutor from '../Executors/LadderExecutor'; | ||
*/ | ||
readonly isRunning: boolean; | ||
get isRunning(): boolean; | ||
/** | ||
@@ -21,3 +21,3 @@ * We tried to load, but list is empty | ||
*/ | ||
readonly isEmpty: boolean; | ||
get isEmpty(): boolean; | ||
/** | ||
@@ -27,3 +27,3 @@ * We tried to load, and list is not empty | ||
*/ | ||
readonly isFull: boolean; | ||
get isFull(): boolean; | ||
/** | ||
@@ -30,0 +30,0 @@ * Loads a bunch of items |
@@ -12,5 +12,5 @@ export declare type RetrierExecutorCommand = () => boolean; | ||
static waitUntil(command: RetrierExecutorCommand, timeout?: number, maxTime?: number): Promise<void>; | ||
readonly timeElapsed: number; | ||
get timeElapsed(): number; | ||
protected takesTooLong(): boolean; | ||
run(): Promise<void>; | ||
} |
{ | ||
"name": "asva-executors", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"description": "Helper classes for your async flow control", | ||
@@ -13,3 +13,3 @@ "main": "dist/src/index.js", | ||
"build": "yarn build-webpack & yarn build-rollup", | ||
"build-webpack": "webpack --progress --hide-modules --config src/build/webpack-config-build.js", | ||
"build-webpack": "webpack --progress --config src/build/webpack-config-build.js", | ||
"build-rollup": "rollup -c", | ||
@@ -33,30 +33,29 @@ "test": "karma start --single-run", | ||
"dependencies": { | ||
"tslib": "^1.9.3" | ||
"tslib": "^2.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jasmine": "^2.8.6", | ||
"@types/node": "^9.6.2", | ||
"@types/jasmine": "^3.7.6", | ||
"@types/node": "^15.9.0", | ||
"babel-core": "^6.24.1", | ||
"babel-loader": "^7.0.0", | ||
"babel-loader": "^8.2.2", | ||
"babel-plugin-transform-async-to-generator": "^6.24.1", | ||
"babel-preset-env": "^1.6.1", | ||
"clean-webpack-plugin": "^0.1.16", | ||
"html-webpack-plugin": "^3.2.0", | ||
"clean-webpack-plugin": "^4.0.0-alpha.0", | ||
"html-webpack-plugin": "^5.3.1", | ||
"jasmine-core": "^3.1.0", | ||
"karma": "^2.0.0", | ||
"karma-chrome-launcher": "^2.1.0", | ||
"karma-coverage": "^1.1.1", | ||
"karma-jasmine": "^1.1.0", | ||
"karma": "^6.3.3", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-coverage": "^2.0.3", | ||
"karma-jasmine": "^4.0.1", | ||
"karma-requirejs": "^1.1.0", | ||
"karma-typescript": "^3.0.12", | ||
"karma-webpack": "^3.0.0", | ||
"karma-typescript": "^5.5.1", | ||
"karma-webpack": "^5.0.0", | ||
"requirejs": "^2.3.5", | ||
"rollup-plugin-typescript": "^0.8.1", | ||
"ts-loader": "^4.2.0", | ||
"typedoc": "^0.11.1", | ||
"typedoc-webpack-plugin": "^1.1.4", | ||
"typescript": "^2.8.1", | ||
"webpack": "~4.5.0", | ||
"webpack-cli": "^2.0.14", | ||
"webpack-merge": "^4.1.0" | ||
"rollup-plugin-typescript": "^1.0.1", | ||
"ts-loader": "^9.2.2", | ||
"typedoc": "^0.20.36", | ||
"typescript": "^4.3.2", | ||
"webpack": "~5.38.1", | ||
"webpack-cli": "^4.7.0", | ||
"webpack-merge": "^5.7.3" | ||
}, | ||
@@ -63,0 +62,0 @@ "engines": { |
const config = require('./config.js') | ||
const CleanWebpackPlugin = require('clean-webpack-plugin') | ||
const TypedocWebpackPlugin = require('typedoc-webpack-plugin') | ||
const { CleanWebpackPlugin } = require('clean-webpack-plugin') | ||
module.exports = function () { | ||
return { | ||
mode: 'development', | ||
mode: 'production', | ||
devtool: 'source-map', | ||
entry: { | ||
@@ -17,2 +17,5 @@ app: config.FOLDERS.SRC + '/index.ts', | ||
}, | ||
externals: { | ||
tslib: 'tslib', | ||
}, | ||
resolve: { | ||
@@ -40,8 +43,5 @@ extensions: ['.ts'], | ||
plugins: [ | ||
new CleanWebpackPlugin(['dist'], { root: config.FOLDERS.ROOT }), | ||
new TypedocWebpackPlugin({ | ||
target: 'es2017', | ||
}), | ||
new CleanWebpackPlugin(), | ||
], | ||
} | ||
} |
@@ -6,2 +6,3 @@ { | ||
"module": "es2015", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | ||
"outDir": "dist/src", | ||
"lib": [ /* Specify library files to be included in the compilation: */ | ||
@@ -65,2 +66,2 @@ "dom", | ||
} | ||
} | ||
} |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
24
43
76587
1141
1
+ Addedtslib@2.8.1(transitive)
- Removedtslib@1.14.1(transitive)
Updatedtslib@^2.2.0