1 | This intersection observer component is an invisible watcher that emits events when it appears and
|
2 | dissapears from view.
|
3 |
|
4 | It acts a a vue-friendly wrapper around the [intersection observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API).
|
5 |
|
6 | Because of it's simplicity you can use it for a lot of different things.
|
7 | It's especially helpful for the lazy loading of images, and infinite scrolling of lists.
|
8 |
|
9 | Anything slotted inside this component will become the element that is being observed.
|
10 |
|
11 | This slot can also be used as a fallback for the browsers that don't support the intersection
|
12 | observer, or in the case that the observer fails to work.
|
13 | For example, adding a "Fetch more posts" button inside an observer that should fetch more posts
|
14 | automatically when visible. If the observer fails to work for any reason, the button will still be
|
15 | clickable, and the experience preserved. Please use a fallback wherever possible as
|
16 | **the intersection observer API is not supported in IE11**.
|