Skip to content

Commit ec8773f

Browse files
committed
return Promise on load
1 parent 5dbfbfb commit ec8773f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Emitter(More.prototype)
3636
* @api private
3737
*/
3838
More.prototype.onscroll = function (e) {
39-
if (this.loading || this._disabled) return
39+
if (this.loading || this._disabled) return Promise.resolve(null)
4040
if (!check(this.el, this.scrollable, this.paddingBottom) && e !== true) return
4141
this.div.style.visibility = 'visible'
4242
// var h = computedStyle(this.el, 'height')
@@ -51,8 +51,9 @@ More.prototype.onscroll = function (e) {
5151
}
5252
var res = this.callback(cb)
5353
if (res && typeof res.then === 'function') {
54-
res.then(cb, cb)
54+
return res.then(cb, cb)
5555
}
56+
return Promise.resolve(null)
5657
}
5758

5859
/**
@@ -85,7 +86,7 @@ More.prototype.enable = function () {
8586
* @api public
8687
*/
8788
More.prototype.load = function () {
88-
this.onscroll(true)
89+
return this.onscroll(true)
8990
}
9091

9192
/**

0 commit comments

Comments
 (0)