File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
1
import $ from 'tealight' ;
2
2
3
- let lastResponse = document ;
4
- let nextUrl ;
5
-
6
3
export function nextHandler ( pageIndex ) {
4
+ if ( ! this . lastResponse ) {
5
+ this . lastResponse = document ;
6
+ }
7
+ let nextUrl ;
7
8
let ias = this ;
8
9
9
- let nextEl = $ ( ias . options . next , lastResponse ) [ 0 ] ;
10
+ let nextEl = $ ( ias . options . next , this . lastResponse ) [ 0 ] ;
10
11
11
12
if ( ! nextEl ) {
12
13
return ;
@@ -16,9 +17,9 @@ export function nextHandler(pageIndex) {
16
17
17
18
return ias . load ( nextUrl )
18
19
. then ( ( data ) => {
19
- lastResponse = data . xhr . response ;
20
+ this . lastResponse = data . xhr . response ;
20
21
21
- let nextEl = $ ( ias . options . next , lastResponse ) [ 0 ] ;
22
+ let nextEl = $ ( ias . options . next , this . lastResponse ) [ 0 ] ;
22
23
23
24
return ias . append ( data . items )
24
25
. then ( ( ) => {
You can’t perform that action at this time.
0 commit comments