metafizzy / infinite-scroll

📜 Automatically add next page
https://infinite-scroll.com
7.41k stars 1.74k forks source link

Update page-load.js #935

Closed rslanzi closed 3 years ago

rslanzi commented 3 years ago

Check if this.options.outlayer.appended is a function to prevent error in case of misconfiguration.

desandro commented 3 years ago

Thanks for this contribution. I can see how this prevents the error, but I think maybe it's better to trigger the error so the user knows that the options have been mis-configured. Could you elaborate on what situation caused this error for you?

rslanzi commented 3 years ago

I took over an existing project with isotope used externally to InfiniteScroll and at the outlayer parameter it has set it to "true" (WTF :-)) but instead of rewriting all the code, I thought of bypassing the error. But you're probably right... better to see the error. Although this implies that I will have to understand what has been done in this project. 😓

desandro commented 3 years ago

Thanks for that. I see how that can help you out, but I feel like its not a bigger issue that could help out others. I'll have to pass on this contribution.