1 /** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { AsyncAction } from './AsyncAction';
4 var AnimationFrameAction = /*@__PURE__*/ (function (_super) {
5 tslib_1.__extends(AnimationFrameAction, _super);
6 function AnimationFrameAction(scheduler, work) {
7 var _this = _super.call(this, scheduler, work) || this;
8 _this.scheduler = scheduler;
12 AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
13 if (delay === void 0) {
16 if (delay !== null && delay > 0) {
17 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
19 scheduler.actions.push(this);
20 return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
22 AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
23 if (delay === void 0) {
26 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
27 return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
29 if (scheduler.actions.length === 0) {
30 cancelAnimationFrame(id);
31 scheduler.scheduled = undefined;
35 return AnimationFrameAction;
37 export { AnimationFrameAction };
38 //# sourceMappingURL=AnimationFrameAction.js.map