@infinite-list/data-model
Advanced tools
Comparing version 0.4.12-batchinator-alpha.0 to 0.4.12-batchinator-alpha.1
{ | ||
"name": "@infinite-list/data-model", | ||
"version": "0.4.12-batchinator-alpha.0", | ||
"version": "0.4.12-batchinator-alpha.1", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist", |
@@ -68,27 +68,27 @@ // @ts-nocheck | ||
this._args = args; | ||
this._callback.apply(this, this._args); | ||
// if (this._taskHandle) return; | ||
// const handler = this._leading | ||
// ? () => { | ||
// this._taskHandle = null; | ||
// } | ||
// : () => { | ||
// this._taskHandle = null; | ||
// this._callback.apply(this, this._args); | ||
// }; | ||
if (this._taskHandle) return; | ||
const handler = this._leading | ||
? () => { | ||
this._taskHandle = null; | ||
} | ||
: () => { | ||
this._taskHandle = null; | ||
this._callback.apply(this, this._args); | ||
}; | ||
// if (!this._delayMS) { | ||
// handler(); | ||
// return; | ||
// } | ||
if (!this._delayMS) { | ||
handler(); | ||
return; | ||
} | ||
// if (this._leading) { | ||
// this._callback.apply(this, this._args); | ||
// } | ||
if (this._leading) { | ||
this._callback.apply(this, this._args); | ||
} | ||
// const timeoutHandle = setTimeout(() => { | ||
// handler(); | ||
// }, this._delayMS); | ||
const timeoutHandle = setTimeout(() => { | ||
handler(); | ||
}, this._delayMS); | ||
this._taskHandle = { cancel: () => clearTimeout(timeoutHandle) }; | ||
// this._taskHandle = { cancel: () => clearTimeout(timeoutHandle) }; | ||
} | ||
@@ -95,0 +95,0 @@ } |
@@ -246,4 +246,5 @@ import { | ||
if (!this.hasHandler()) return; | ||
if (isEndReached && !this.isConsecutiveDistance(distanceFromEnd)) { | ||
// if (!this.hasHandler()) return; | ||
// if (isEndReached && !this.isConsecutiveDistance(distanceFromEnd)) { | ||
if (isEndReached) { | ||
this.onEndReachedHandler({ | ||
@@ -250,0 +251,0 @@ distanceFromEnd, |
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
3638118
44511