Print error from usePagination
This commit is contained in:
parent
4bbadeb27c
commit
b40a114168
|
@ -91,9 +91,15 @@ export const usePagination = <T>(opts: PaginationOptions<T>) => {
|
||||||
const nextQ = lastDoc
|
const nextQ = lastDoc
|
||||||
? query(state.baseQ, startAfter(lastDoc), limit(state.pageSize))
|
? query(state.baseQ, startAfter(lastDoc), limit(state.pageSize))
|
||||||
: query(state.baseQ, limit(state.pageSize))
|
: query(state.baseQ, limit(state.pageSize))
|
||||||
return onSnapshot(nextQ, (snapshot) => {
|
return onSnapshot(
|
||||||
dispatch({ type: 'LOAD', snapshot })
|
nextQ,
|
||||||
})
|
(snapshot) => {
|
||||||
|
dispatch({ type: 'LOAD', snapshot })
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
console.error('error', error)
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}, [state.isLoading, state.baseQ, state.docs, state.pageSize])
|
}, [state.isLoading, state.baseQ, state.docs, state.pageSize])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user