How to manipulate the rendered template using Javascript

I am looking to implement a simple lazy loading feature using Intersection Observer. However, I don’t fully understand the Algolia rendering lifecycle – particular when using Wordpress. Is there a hook I can use to ensure my Intersection Observer runs after the Algolia template is rendered?