Skip to content

Commit d1fe819

Browse files
committed
delete redundant useless onEveryStartCallback
1 parent 875cad1 commit d1fe819

6 files changed

Lines changed: 0 additions & 65 deletions

File tree

‎dist/tween.amd.js‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,6 @@ define(['exports'], (function (exports) { 'use strict';
10191019
this._isPaused = false;
10201020
this._pauseStart = 0;
10211021
this._onStartCallbackFired = false;
1022-
this._onEveryStartCallbackFired = false;
10231022
// Empty on purpose. Use `.add()` to compose.
10241023
// Sequential by default, parallel via explicit offsets, labels, or options.
10251024
}
@@ -1244,7 +1243,6 @@ define(['exports'], (function (exports) { 'use strict';
12441243
cloned._labels[name_1] = this._labels[name_1];
12451244
}
12461245
cloned._onStartCallback = this._onStartCallback;
1247-
cloned._onEveryStartCallback = this._onEveryStartCallback;
12481246
cloned._onUpdateCallback = this._onUpdateCallback;
12491247
cloned._onCompleteCallback = this._onCompleteCallback;
12501248
cloned._onStopCallback = this._onStopCallback;
@@ -1282,10 +1280,6 @@ define(['exports'], (function (exports) { 'use strict';
12821280
this._onStartCallback = callback;
12831281
return this;
12841282
};
1285-
Timeline.prototype.onEveryStart = function (callback) {
1286-
this._onEveryStartCallback = callback;
1287-
return this;
1288-
};
12891283
Timeline.prototype.onUpdate = function (callback) {
12901284
this._onUpdateCallback = callback;
12911285
return this;
@@ -1330,7 +1324,6 @@ define(['exports'], (function (exports) { 'use strict';
13301324
this._isPlaying = true;
13311325
this._isPaused = false;
13321326
this._onStartCallbackFired = false;
1333-
this._onEveryStartCallbackFired = false;
13341327
this._startTime = time;
13351328
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {
13361329
var entry = _a[_i];
@@ -1392,11 +1385,6 @@ define(['exports'], (function (exports) { 'use strict';
13921385
this._onStartCallback(this);
13931386
this._onStartCallbackFired = true;
13941387
}
1395-
if (!this._onEveryStartCallbackFired) {
1396-
if (this._onEveryStartCallback)
1397-
this._onEveryStartCallback(this);
1398-
this._onEveryStartCallbackFired = true;
1399-
}
14001388
var timelineLocal = time - this._startTime;
14011389
var effectiveLocal = !isFinite(this._duration) ? timelineLocal : Math.min(timelineLocal, this._duration);
14021390
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {

‎dist/tween.cjs‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,6 @@ var Timeline = /** @class */ (function () {
10211021
this._isPaused = false;
10221022
this._pauseStart = 0;
10231023
this._onStartCallbackFired = false;
1024-
this._onEveryStartCallbackFired = false;
10251024
// Empty on purpose. Use `.add()` to compose.
10261025
// Sequential by default, parallel via explicit offsets, labels, or options.
10271026
}
@@ -1246,7 +1245,6 @@ var Timeline = /** @class */ (function () {
12461245
cloned._labels[name_1] = this._labels[name_1];
12471246
}
12481247
cloned._onStartCallback = this._onStartCallback;
1249-
cloned._onEveryStartCallback = this._onEveryStartCallback;
12501248
cloned._onUpdateCallback = this._onUpdateCallback;
12511249
cloned._onCompleteCallback = this._onCompleteCallback;
12521250
cloned._onStopCallback = this._onStopCallback;
@@ -1284,10 +1282,6 @@ var Timeline = /** @class */ (function () {
12841282
this._onStartCallback = callback;
12851283
return this;
12861284
};
1287-
Timeline.prototype.onEveryStart = function (callback) {
1288-
this._onEveryStartCallback = callback;
1289-
return this;
1290-
};
12911285
Timeline.prototype.onUpdate = function (callback) {
12921286
this._onUpdateCallback = callback;
12931287
return this;
@@ -1332,7 +1326,6 @@ var Timeline = /** @class */ (function () {
13321326
this._isPlaying = true;
13331327
this._isPaused = false;
13341328
this._onStartCallbackFired = false;
1335-
this._onEveryStartCallbackFired = false;
13361329
this._startTime = time;
13371330
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {
13381331
var entry = _a[_i];
@@ -1394,11 +1387,6 @@ var Timeline = /** @class */ (function () {
13941387
this._onStartCallback(this);
13951388
this._onStartCallbackFired = true;
13961389
}
1397-
if (!this._onEveryStartCallbackFired) {
1398-
if (this._onEveryStartCallback)
1399-
this._onEveryStartCallback(this);
1400-
this._onEveryStartCallbackFired = true;
1401-
}
14021390
var timelineLocal = time - this._startTime;
14031391
var effectiveLocal = !isFinite(this._duration) ? timelineLocal : Math.min(timelineLocal, this._duration);
14041392
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {

‎dist/tween.d.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ declare class Timeline {
258258
private _pauseStart;
259259
private _onStartCallback?;
260260
private _onStartCallbackFired;
261-
private _onEveryStartCallback?;
262-
private _onEveryStartCallbackFired;
263261
private _onUpdateCallback?;
264262
private _onCompleteCallback?;
265263
private _onStopCallback?;
@@ -317,7 +315,6 @@ declare class Timeline {
317315
remove(...nodes: Array<TimelineChild>): this;
318316
removeAll(): this;
319317
onStart(callback?: (timeline: Timeline) => void): this;
320-
onEveryStart(callback?: (timeline: Timeline) => void): this;
321318
onUpdate(callback?: (timeline: Timeline, elapsed: number) => void): this;
322319
onComplete(callback?: (timeline: Timeline) => void): this;
323320
onStop(callback?: (timeline: Timeline) => void): this;

‎dist/tween.esm.js‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,6 @@ var Timeline = /** @class */ (function () {
10171017
this._isPaused = false;
10181018
this._pauseStart = 0;
10191019
this._onStartCallbackFired = false;
1020-
this._onEveryStartCallbackFired = false;
10211020
// Empty on purpose. Use `.add()` to compose.
10221021
// Sequential by default, parallel via explicit offsets, labels, or options.
10231022
}
@@ -1242,7 +1241,6 @@ var Timeline = /** @class */ (function () {
12421241
cloned._labels[name_1] = this._labels[name_1];
12431242
}
12441243
cloned._onStartCallback = this._onStartCallback;
1245-
cloned._onEveryStartCallback = this._onEveryStartCallback;
12461244
cloned._onUpdateCallback = this._onUpdateCallback;
12471245
cloned._onCompleteCallback = this._onCompleteCallback;
12481246
cloned._onStopCallback = this._onStopCallback;
@@ -1280,10 +1278,6 @@ var Timeline = /** @class */ (function () {
12801278
this._onStartCallback = callback;
12811279
return this;
12821280
};
1283-
Timeline.prototype.onEveryStart = function (callback) {
1284-
this._onEveryStartCallback = callback;
1285-
return this;
1286-
};
12871281
Timeline.prototype.onUpdate = function (callback) {
12881282
this._onUpdateCallback = callback;
12891283
return this;
@@ -1328,7 +1322,6 @@ var Timeline = /** @class */ (function () {
13281322
this._isPlaying = true;
13291323
this._isPaused = false;
13301324
this._onStartCallbackFired = false;
1331-
this._onEveryStartCallbackFired = false;
13321325
this._startTime = time;
13331326
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {
13341327
var entry = _a[_i];
@@ -1390,11 +1383,6 @@ var Timeline = /** @class */ (function () {
13901383
this._onStartCallback(this);
13911384
this._onStartCallbackFired = true;
13921385
}
1393-
if (!this._onEveryStartCallbackFired) {
1394-
if (this._onEveryStartCallback)
1395-
this._onEveryStartCallback(this);
1396-
this._onEveryStartCallbackFired = true;
1397-
}
13981386
var timelineLocal = time - this._startTime;
13991387
var effectiveLocal = !isFinite(this._duration) ? timelineLocal : Math.min(timelineLocal, this._duration);
14001388
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {

‎dist/tween.umd.js‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,6 @@
10231023
this._isPaused = false;
10241024
this._pauseStart = 0;
10251025
this._onStartCallbackFired = false;
1026-
this._onEveryStartCallbackFired = false;
10271026
// Empty on purpose. Use `.add()` to compose.
10281027
// Sequential by default, parallel via explicit offsets, labels, or options.
10291028
}
@@ -1248,7 +1247,6 @@
12481247
cloned._labels[name_1] = this._labels[name_1];
12491248
}
12501249
cloned._onStartCallback = this._onStartCallback;
1251-
cloned._onEveryStartCallback = this._onEveryStartCallback;
12521250
cloned._onUpdateCallback = this._onUpdateCallback;
12531251
cloned._onCompleteCallback = this._onCompleteCallback;
12541252
cloned._onStopCallback = this._onStopCallback;
@@ -1286,10 +1284,6 @@
12861284
this._onStartCallback = callback;
12871285
return this;
12881286
};
1289-
Timeline.prototype.onEveryStart = function (callback) {
1290-
this._onEveryStartCallback = callback;
1291-
return this;
1292-
};
12931287
Timeline.prototype.onUpdate = function (callback) {
12941288
this._onUpdateCallback = callback;
12951289
return this;
@@ -1334,7 +1328,6 @@
13341328
this._isPlaying = true;
13351329
this._isPaused = false;
13361330
this._onStartCallbackFired = false;
1337-
this._onEveryStartCallbackFired = false;
13381331
this._startTime = time;
13391332
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {
13401333
var entry = _a[_i];
@@ -1396,11 +1389,6 @@
13961389
this._onStartCallback(this);
13971390
this._onStartCallbackFired = true;
13981391
}
1399-
if (!this._onEveryStartCallbackFired) {
1400-
if (this._onEveryStartCallback)
1401-
this._onEveryStartCallback(this);
1402-
this._onEveryStartCallbackFired = true;
1403-
}
14041392
var timelineLocal = time - this._startTime;
14051393
var effectiveLocal = !isFinite(this._duration) ? timelineLocal : Math.min(timelineLocal, this._duration);
14061394
for (var _i = 0, _a = this._entries; _i < _a.length; _i++) {

‎src/Timeline.ts‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export class Timeline {
7575

7676
private _onStartCallback?: (timeline: Timeline) => void
7777
private _onStartCallbackFired = false
78-
private _onEveryStartCallback?: (timeline: Timeline) => void
79-
private _onEveryStartCallbackFired = false
8078
private _onUpdateCallback?: (timeline: Timeline, elapsed: number) => void
8179
private _onCompleteCallback?: (timeline: Timeline) => void
8280
private _onStopCallback?: (timeline: Timeline) => void
@@ -312,7 +310,6 @@ export class Timeline {
312310
if (name !== 'start' && name !== 'end') cloned._labels[name] = this._labels[name]
313311
}
314312
cloned._onStartCallback = this._onStartCallback
315-
cloned._onEveryStartCallback = this._onEveryStartCallback
316313
cloned._onUpdateCallback = this._onUpdateCallback
317314
cloned._onCompleteCallback = this._onCompleteCallback
318315
cloned._onStopCallback = this._onStopCallback
@@ -344,11 +341,6 @@ export class Timeline {
344341
return this
345342
}
346343

347-
onEveryStart(callback?: (timeline: Timeline) => void): this {
348-
this._onEveryStartCallback = callback
349-
return this
350-
}
351-
352344
onUpdate(callback?: (timeline: Timeline, elapsed: number) => void): this {
353345
this._onUpdateCallback = callback
354346
return this
@@ -391,7 +383,6 @@ export class Timeline {
391383
this._isPlaying = true
392384
this._isPaused = false
393385
this._onStartCallbackFired = false
394-
this._onEveryStartCallbackFired = false
395386
this._startTime = time
396387

397388
for (const entry of this._entries) {
@@ -450,11 +441,6 @@ export class Timeline {
450441
this._onStartCallbackFired = true
451442
}
452443

453-
if (!this._onEveryStartCallbackFired) {
454-
if (this._onEveryStartCallback) this._onEveryStartCallback(this)
455-
this._onEveryStartCallbackFired = true
456-
}
457-
458444
const timelineLocal = time - this._startTime
459445

460446
const effectiveLocal = !isFinite(this._duration) ? timelineLocal : Math.min(timelineLocal, this._duration)

0 commit comments

Comments
 (0)