Comparing version 1.6.0 to 1.6.1
@@ -34,11 +34,2 @@ import { Reactive } from './reactive'; | ||
} | ||
shouldIgnorePausedMethod(method) { | ||
const methodName = method.name; | ||
return this.paused && !ALLOWED_METHODS_WHEN_PAUSED.includes(methodName); | ||
} | ||
getPausedMethodResult(method) { | ||
var _a, _b; | ||
(_b = (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log) === null || _b === void 0 ? void 0 : _b.call(_a, () => 'scroller is paused: ' + method.name + ' method is ignored'); | ||
return Promise.resolve(methodPausedResult); | ||
} | ||
getPromisifiedMethod(method, args) { | ||
@@ -52,8 +43,15 @@ return new Promise(resolve => { | ||
} | ||
getWorkflowRunnerMethod(method, defaultMethod) { | ||
return (...args) => !this.relax$ | ||
? defaultMethod.apply(this, args) | ||
: this.shouldIgnorePausedMethod(method) | ||
? this.getPausedMethodResult(method) | ||
: this.getPromisifiedMethod(method, args); | ||
getWorkflowRunnerMethod(method, name) { | ||
return (...args) => { | ||
var _a, _b, _c, _d; | ||
if (!this.relax$) { | ||
(_b = (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log) === null || _b === void 0 ? void 0 : _b.call(_a, () => 'scroller is not initialized: ' + name + ' method is ignored'); | ||
return Promise.resolve(methodPreResult); | ||
} | ||
if (this.paused && !ALLOWED_METHODS_WHEN_PAUSED.includes(name)) { | ||
(_d = (_c = this.logger) === null || _c === void 0 ? void 0 : _c.log) === null || _d === void 0 ? void 0 : _d.call(_c, () => 'scroller is paused: ' + name + ' method is ignored'); | ||
return Promise.resolve(methodPausedResult); | ||
} | ||
return this.getPromisifiedMethod(method, args); | ||
}; | ||
} | ||
@@ -174,3 +172,3 @@ constructor(context, getWorkflow, logger) { | ||
.forEach((prop) => { | ||
const { name, type, value: defaultValue, permanent } = prop; | ||
const { name, type, permanent } = prop; | ||
let value = this[name]; | ||
@@ -181,3 +179,3 @@ if (type === AdapterPropType.Function) { | ||
else if (type === AdapterPropType.WorkflowRunner) { | ||
value = this.getWorkflowRunnerMethod(value, defaultValue); | ||
value = this.getWorkflowRunnerMethod(value, name); | ||
} | ||
@@ -184,0 +182,0 @@ else if (type === AdapterPropType.Reactive && reactivePropsStore[name]) { |
export default { | ||
name: 'vscroll', | ||
version: '1.6.0' | ||
version: '1.6.1' | ||
}; | ||
//# sourceMappingURL=version.js.map |
@@ -155,3 +155,3 @@ import { __assign, __read } from "tslib"; | ||
.forEach(function (prop) { | ||
var name = prop.name, type = prop.type, defaultValue = prop.value, permanent = prop.permanent; | ||
var name = prop.name, type = prop.type, permanent = prop.permanent; | ||
var value = _this[name]; | ||
@@ -162,3 +162,3 @@ if (type === AdapterPropType.Function) { | ||
else if (type === AdapterPropType.WorkflowRunner) { | ||
value = _this.getWorkflowRunnerMethod(value, defaultValue); | ||
value = _this.getWorkflowRunnerMethod(value, name); | ||
} | ||
@@ -207,11 +207,2 @@ else if (type === AdapterPropType.Reactive && reactivePropsStore[name]) { | ||
}); | ||
Adapter.prototype.shouldIgnorePausedMethod = function (method) { | ||
var methodName = method.name; | ||
return this.paused && !ALLOWED_METHODS_WHEN_PAUSED.includes(methodName); | ||
}; | ||
Adapter.prototype.getPausedMethodResult = function (method) { | ||
var _a, _b; | ||
(_b = (_a = this.logger) === null || _a === void 0 ? void 0 : _a.log) === null || _b === void 0 ? void 0 : _b.call(_a, function () { return 'scroller is paused: ' + method.name + ' method is ignored'; }); | ||
return Promise.resolve(methodPausedResult); | ||
}; | ||
Adapter.prototype.getPromisifiedMethod = function (method, args) { | ||
@@ -226,5 +217,6 @@ var _this = this; | ||
}; | ||
Adapter.prototype.getWorkflowRunnerMethod = function (method, defaultMethod) { | ||
Adapter.prototype.getWorkflowRunnerMethod = function (method, name) { | ||
var _this = this; | ||
return function () { | ||
var _a, _b, _c, _d; | ||
var args = []; | ||
@@ -234,7 +226,11 @@ for (var _i = 0; _i < arguments.length; _i++) { | ||
} | ||
return !_this.relax$ | ||
? defaultMethod.apply(_this, args) | ||
: _this.shouldIgnorePausedMethod(method) | ||
? _this.getPausedMethodResult(method) | ||
: _this.getPromisifiedMethod(method, args); | ||
if (!_this.relax$) { | ||
(_b = (_a = _this.logger) === null || _a === void 0 ? void 0 : _a.log) === null || _b === void 0 ? void 0 : _b.call(_a, function () { return 'scroller is not initialized: ' + name + ' method is ignored'; }); | ||
return Promise.resolve(methodPreResult); | ||
} | ||
if (_this.paused && !ALLOWED_METHODS_WHEN_PAUSED.includes(name)) { | ||
(_d = (_c = _this.logger) === null || _c === void 0 ? void 0 : _c.log) === null || _d === void 0 ? void 0 : _d.call(_c, function () { return 'scroller is paused: ' + name + ' method is ignored'; }); | ||
return Promise.resolve(methodPausedResult); | ||
} | ||
return _this.getPromisifiedMethod(method, args); | ||
}; | ||
@@ -241,0 +237,0 @@ }; |
export default { | ||
name: 'vscroll', | ||
version: '1.6.0' | ||
version: '1.6.1' | ||
}; | ||
//# sourceMappingURL=version.js.map |
@@ -56,4 +56,2 @@ import { Logger } from './logger'; | ||
private relaxRun; | ||
private shouldIgnorePausedMethod; | ||
private getPausedMethodResult; | ||
private getPromisifiedMethod; | ||
@@ -60,0 +58,0 @@ private getWorkflowRunnerMethod; |
{ | ||
"name": "vscroll", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "Virtual scroll engine", | ||
@@ -5,0 +5,0 @@ "main": "dist/bundles/vscroll.umd.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7073655
31209