|
|
@@ -149,9 +149,9 @@ export default {
|
|
149
|
149
|
// console.warn('attach to: ',footerEl)
|
|
150
|
150
|
if(!footerEl) return
|
|
151
|
151
|
const onIntersect = entries => {
|
|
152
|
|
- if(this.isFetching) return
|
|
|
152
|
+ // if(this.isFetching) return
|
|
153
|
153
|
|
|
154
|
|
- this.isFetching = true
|
|
|
154
|
+ // this.isFetching = true
|
|
155
|
155
|
entries.forEach(({ target, isIntersecting }) => {
|
|
156
|
156
|
if (!isIntersecting) return
|
|
157
|
157
|
this.observer.unobserve(target)
|
|
|
@@ -160,7 +160,7 @@ export default {
|
|
160
|
160
|
console.log("intersected:", target)
|
|
161
|
161
|
}, 1000)
|
|
162
|
162
|
})
|
|
163
|
|
- this.isFetching = false
|
|
|
163
|
+ // this.isFetching = false
|
|
164
|
164
|
// this.loadMorePosts()
|
|
165
|
165
|
// console.log('loaded...', this.loadMorePosts)
|
|
166
|
166
|
// console.log('cb this:', this)
|
|
|
@@ -172,6 +172,7 @@ export default {
|
|
172
|
172
|
threshold: 1.0,
|
|
173
|
173
|
}
|
|
174
|
174
|
)
|
|
|
175
|
+ this.observer.observe(footerEl)
|
|
175
|
176
|
},
|
|
176
|
177
|
unsetIntersectionLoader(type) {
|
|
177
|
178
|
if(!type) return console.error('cannot unset intersection handler for undefined type...')
|