#Use the client:visible functionality with plain js?

6 messages · Page 1 of 1 (latest)

hybrid glen
#

Hey, I'd like to use the functionality that lets me hydrate a component only when its visible, but I'm not using any framework. Is this doable in with vanilla js?

cunning haven
light owl
#

Creating it yourself is fairly easy though

#

There's a bit more fluff and boilerplate because of how it needs to work with components, but the gist of it is really just creating an observer and wrapping your code in a if intersecting.