UNPKG

gridsome

Version:

A JAMstack framework for building blazing fast websites with Vue.js

12 lines (10 loc) 235 B
export function createObserver (handler, options = {}) { const observer = new IntersectionObserver(entries => { entries.forEach(handler) }, { rootMargin: '20px', threshold: 0.1, ...options }) return observer }