Is there a method to know if the infinite-scroll is currently active?

I wrote a lot of if (isInfiniteActive) in my code and I wonder if there’s a way to check if infinite scroll is active, or something like that.