chrishurlburt / vue-scrollview

A Vue.js component for detecting when components are visible in the viewport via the Vue.js scoped slots api.
MIT License
116 stars 8 forks source link

Implement visibility listening through Intersection Observer API #11

Open string-areeb opened 5 years ago

string-areeb commented 5 years ago

https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

The Intersection Observer API provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.

It is much more efficient and its polyfill is very simple for browsers which do not support it that its code is already in this library

chrishurlburt commented 5 years ago

@string-areeb I would happily merge any PR that implements this 😄

string-areeb commented 5 years ago

Thanks. Will try to implement it in a few days